ns-indexer

Crates.ions-indexer
lib.rsns-indexer
version0.6.0
sourcesrc
created_at2023-12-23 03:23:42.517884
updated_at2024-01-14 10:33:52.555985
descriptionName & Service Protocol indexer service in Rust
homepage
repositoryhttps://github.com/ldclabs/ns-rs/tree/main/crates/ns-indexer
max_upload_size
id1078820
size225,226
0xZensh (zensh)

documentation

README

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.

Commit count: 0

cargo fmt