mempool / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
74 stars 35 forks source link

Mempool - Electrs backend API

A block chain index engine and HTTP API written in Rust based on romanz/electrs and Blockstream/electrs.

Used as the backend for the mempool block explorer powering mempool.space.

API documentation is available here.

Documentation for the database schema and indexing process is available here.

Installing & indexing

Install Rust, Bitcoin Core (no txindex needed) and the clang and cmake packages, then:

$ git clone https://github.com/mempool/electrs && cd electrs
$ git checkout mempool
$ cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.bitcoin

# Or for liquid:
$ cargo run --features liquid --release --bin electrs -- -vvvv --network liquid --daemon-dir ~/.liquid

See electrs's original documentation for more detailed instructions. Note that our indexes are incompatible with electrs's and has to be created separately.

The indexes require 1.3TB of storage after running compaction (as of October 2023), but you'll need to have free space of about double that available during the index compaction process. Creating the indexes should take a few hours on a beefy machine with high speed NVMe SSD(s).

Light mode

For personal or low-volume use, you may set --lightmode to reduce disk storage requirements by roughly 50% at the cost of slower and more expensive lookups.

With this option set, raw transactions and metadata associated with blocks will not be kept in rocksdb (the T, X and M indexes), but instead queried from bitcoind on demand.

Notable changes from Electrs:

CLI options

In addition to electrs's original configuration options, a few new options are also available:

Additional options with the liquid feature:

Additional options with the electrum-discovery feature:

See $ cargo run --bin electrs -- --help for the full list of options.

License

MIT