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
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.
Ord20 Indexer and its prerequisites can be installed from the command line.
-
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.
-
Install PostgreSQL
- PostgreSQL (Linux)
Start PostgreSQL CLI as the
sudo apt-get install postgresql postgresql-client
postgres
userModify the PostgreSQL passwordsudo -u postgres psql
sudo -u postgres psql \\password
- PostgreSQL (Mac)
Start the server:
brew install postgresql
brew services start postgresql
- Install Diesel
cargo install diesel_cli --no-default-features --features postgres
-
Clone the repo and build the binary
git clone https://github.com/ynohtna92/ord20-indexer.git cd ord20-indexer cargo build --release
-
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/*
-
Edit the
litecoin.conf
file of the full nodecd ~/.litecoin vi litecoin.conf
Add the following configurations and save
txindex=1 rpcserialversion=1
-
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)
-
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
-
Run the ordinals server, and allow it to fully synchronise.
./ord server
-
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
-
Run the database installation scripts
diesel migration run
-
Run the ord-20 indexer
./ord20-indexer
- 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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU v3 License. See LICENSE.txt
for more information.
Twitter/X - @anthonyonchain
Project Link: https://github.com/ynohtna92/ord20-indexer.git