Giter Club home page Giter Club logo

ord20-indexer's Introduction

Ord20 Indexer (ord-20) library

This indexer fully implements the ordinals meta protocol of brc-20/ltc-20/drc-20 to hereby be known as ord-20.

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

Developers of the meta protocol ord-20 can integrate this indexer in the code according to their needs.

Once the indexer is started and connected to a local ordinals server, it will process each block one by one and populate the postgreSQL database with a detailed list of all token information, holder balances, and inscription transfer history.

Getting Started

Ord20 Indexer and its prerequisites can be installed from the command line.

Prerequisites

  1. Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    This project is developed with rust and can be built from source.

  2. Install PostgreSQL

  • PostgreSQL (Linux)
    sudo apt-get install postgresql postgresql-client
    Start PostgreSQL CLI as the postgres user
    sudo -u postgres psql
    
    Modify the PostgreSQL password
    sudo -u postgres psql
    \\password
    
  • PostgreSQL (Mac)
    brew install postgresql
    Start the server:
    brew services start postgresql
    
  1. Install Diesel
    cargo install diesel_cli --no-default-features --features postgres

Installation

  1. Clone the repo and build the binary

    git clone https://github.com/ynohtna92/ord20-indexer.git
    cd ord20-indexer
    cargo build --release
  2. Download Litecoin core 0.21.2.2 from official website https://litecoin.org/

    tar -zxvf litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz
    sudo install -m 0755 -o root -g root -t /usr/local/bin ~/litecoin-0.21.2.2/bin/*
  3. Edit the litecoin.conf file of the full node

    cd ~/.litecoin
    vi litecoin.conf
    

    Add the following configurations and save

    txindex=1
    rpcserialversion=1
    
  4. Run the Litecoin full node until it is fully synchronised (depend on your network, it will generally take up to several hours to days to sync)

  5. Clone the ordinals repo and build the ord server.

    git clone https://github.com/ynohtna92/ord-litecoin.git
    cd ord-litecoin
    git checkout api
    cargo build --release
  6. Run the ordinals server, and allow it to fully synchronise.

    ./ord server
    
  7. Configure the ord20-indexer in your .env file.

    # The ordinals metaprotocol to index (brc-20, ltc-20, drc-20)
    META_PROTOCOL=ltc-20
    
    # Starting index block height
    START_BLOCK=2465225
    
    # How many blocks to stay behind to reduce the impact of block reorganisations (0 = disabled, 6 = recommended)
    BLOCKS_BEHIND=6
    
    # The ordinals server address (https://ordinals.com/, https://ordinalslite.com/, http://localhost/)
    ORDINALS_BASE_URL=http://localhost/
    
    # The postgres database credentials and url
    DATABASE_URL=postgres://postgres:password@localhost/ord20-indexer
    
  8. Run the database installation scripts

    diesel migration run
    
  9. Run the ord-20 indexer

    ./ord20-indexer
    

Roadmap

  • Extend the application to cover multiple ordinal meta protocols.
  • Index directly from full nodes using the binary data found in blocks and transactions

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU v3 License. See LICENSE.txt for more information.

Contact

Twitter/X - @anthonyonchain

Project Link: https://github.com/ynohtna92/ord20-indexer.git

(back to top)

ord20-indexer's People

Contributors

ynohtna92 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.