user23008: 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?

user138902: Here is an example if using Polar.
cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.polar/networks/1/volumes/bitcoind/backend1/ --network=regtest

user23008: 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 127.0.0.1:3002

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

23008: <p>How can I setup a local instance of <a href="https://github.com/Blockstream/electrs" rel="nofollow noreferrer">https://github.com/Blockstream/electrs</a>, for example to test/experiment with the Esplora backend for syncing BDK or LDK?</p>
 138902: <p>Here is an example if using Polar.</p>
<p><code>cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.polar/networks/1/volumes/bitcoind/backend1/ --network=regtest</code></p>
 23008: <p>To setup a local instance running in the <code>regtest</code> network, you basically just have to run <code>bitcoind -regtest</code> as usual, and then  follow the instructions given by the <a href="https://github.com/Blockstream/electrs#installing--indexing" rel="nofollow noreferrer"><code>electrs</code> installation instructions</a>:</p>
<pre><code>$ git clone https://github.com/blockstream/electrs &amp;&amp; cd electrs
$ git checkout new-index
$ cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.bitcoin
</code></pre>
<p>However, you have to give a <code>--network=regtest</code> to the last command and possibly need to adapt you bitcoin dir.</p>
<p>After the chain made some progress, the log outputs of <code>electrs</code> will spit out localhost addresses you can give to BDK, LDK transaction sync, or just an instance of <a href="https://github.com/bitcoindevkit/rust-esplora-client" rel="nofollow noreferrer"><code>rust-esplora-client</code></a>:</p>
<blockquote>
<p>INFO - REST server running on 127.0.0.1:3002</p>
</blockquote>
<p>(Note that an Electrum RPC address is also given in case you prefer to use the Electrum protocol)</p>
