8 releases (5 breaking)

0.6.0 Jan 14, 2024
0.5.0 Jan 8, 2024
0.4.1 Jan 5, 2024
0.3.1 Dec 30, 2023
0.1.0 Dec 23, 2023

#5 in #inscription

Download history 1/week @ 2024-05-21

86 downloads per month
Used in ns-inscriber

CC0 license

245KB
6K SLoC

NS-Indexer — NS-Protocol Indexer service in Rust

License Crates.io CI Docs.rs Latest Version

More information about the protocol can be found in the protocol documentation

Dependencies

  1. Bitcoin RPC server with txindex option enabled, don't need wallet. For example, run a regtest node:
bitcoind -regtest -txindex -rpcuser=test -rpcpassword=123456 -fallbackfee=0.00001
  1. ScyllaDB as a database, run it in a docker container as development environment:
sudo mkdir -p /mnt/scylla/data /mnt/scylla/commitlog /mnt/scylla/hints /mnt/scylla/view_hints
sudo docker run --restart=always --name scylla -d -p 9042:9042 --volume /mnt/scylla:/var/lib/scylla scylladb/scylla:5.2 --smp 1 --memory 2G --developer-mode 0

And then import the CQL schema https://github.com/ldclabs/ns-rs/tree/main/crates/ns-indexer/cql

Development

Run the indexer on local machine

Build:

cargo build --package ns-indexer --bin ns-indexer

Create .env file from sample and edit it:

cp ./crates/ns-indexer/sample.env .env

Run:

./target/debug/ns-indexer

Build for production

Cross compile for linux:

cargo build --release --target x86_64-unknown-linux-musl --package ns-indexer --bin ns-indexer

Docker image

https://github.com/ldclabs/ns-rs/pkgs/container/ns-indexer

API Documentation

Here is the API documentation generated by Insomnia.

The mime type of the request and response in documentation is application/json, but the real mime type is application/cbor.

Dependencies

~35–50MB
~851K SLoC