Giter Club home page Giter Club logo

brc20_indexer's Introduction

BRC20 Indexer

Project Setup Guide

This guide will walk you through setting up the environment for a Node.js project that connects to a MongoDB database, fetches data from the Ordinals Wallet API, and generates various statistics related to valid inscriptions of a specified brc-20 tick.

Prerequisites

  • Node.js and npm installed
  • MongoDB instance (local or cloud-hosted)

Setup

  1. Install dependencies: Run npm install to install the required packages.

  2. Create a .env file: Create a .env file in your project root directory. The code uses the dotenv package to load environment variables from this file.

  3. Set the DB_URI environment variable: In the .env file, define the DB_URI environment variable. The value should be the connection string for your MongoDB instance.

    For a local MongoDB instance:

    DB_URI=mongodb://localhost:27017/your-db-name
    

    For MongoDB Atlas, obtain the connection string from the Atlas dashboard.

  4. Fetch and index inscriptions: Run the following commands in order to fetch and index inscriptions from the Ordinals Wallet API: bash

    node indexers/inscriptions.js
    node indexers/brc20.js
    
  5. Generate statistics: Run the scripts/stats.js script to generate and display the desired information:

    node scripts/stats.js your-tick-value
    
  6. Export data: Run the provided export script to export the data:

    node scripts/export.js your-tick-value
    

    Replace your-tick-value and your-export-script-file.js with the appropriate tick value and export script filename, respectively.


Note: MongoDB creates collections automatically when you insert data, so you don't need to create any collections beforehand. Ensure your .env file contains the correct DB_URI for connecting to your MongoDB instance.

brc20_indexer's People

Contributors

oinoice avatar shep-eth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.