How can I setup a local instance of https://github.com/Blockstream/electrs, for example to test/experiment with the Esplora backend for syncing BDK or LDK?

3 Answers 3


To setup a local instance running in the regtest network, you basically just have to run bitcoind -regtest as usual, and then follow the instructions given by the electrs installation instructions:

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

However, you have to give a --network=regtest to the last command and possibly need to adapt you bitcoin dir.

After the chain made some progress, the log outputs of electrs will spit out localhost addresses you can give to BDK, LDK transaction sync, or just an instance of rust-esplora-client:

INFO - REST server running on

(Note that an Electrum RPC address is also given in case you prefer to use the Electrum protocol)

  • This is how I startup my bitcoind for regtest testing, I also enable filters for any CBF testing: mkdir -p /tmp/regtest1/bitcoind; bitcoind -datadir=/tmp/regtest1/bitcoind -regtest -server -fallbackfee=0.0002 -rpcallowip= -rpcbind= -blockfilterindex=1 -peerblockfilters=1 -daemon For cookie authentication the file is at /tmp/regtest1/bitcoind/regtest/.cookie. Commented Jan 27, 2023 at 15:51

Here is an example if using Polar.

cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.polar/networks/1/volumes/bitcoind/backend1/ --network=regtest


Nigiri is another way of doing it https://nigiri.vulpem.com/ though it comes with other things that you probably want to run yourself

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.