Setup Electrs
Install an Electrum server with Electrs.
Last updated
Was this helpful?
Install an Electrum server with Electrs.
Last updated
Was this helpful?
An Electrum server is an indexing layer built on top of Bitcoin Core. It enables more efficient blockchain queries and easier wallet connections. Most wallets support Electrum.
We're going to use , a Rust implementation of an Electrum Server.
Make sure .
Make sure your node is before proceeding.
Clone the repo:
Source the env file to update your $PATH with Rust & Cargo binaries:
Now you can compile electrs:
Once it's done, test the compilation was successful by checking the version:
Create the configuration file:
Add the following configuration to the config.toml file we just created:
daemon_rpc_addr: Bitcoin JSON-RPC API address and port.
daemon_p2p_addr: Bitcoin P2P address and port.
db_dir: Directory where Electrs store its index file.
electrum_rpc_addr: Electrum will run only on localhost, on port 50001.
We need to create a Tor hidden service to connect our wallets to the Electrum server. Edit the conf file:
Add the following:
Save it then restart tor:
Create the service file:
Add the following:
Line 6,7,8 and 9 make sure to replace your_user by your own user. Finally, reload systemd:
Configure Electrs to automatically start at boot:
Start Electrs:
Electrum will now connect to Bitcoin Core to build its own index of the blockchain.
Indexing is in progress. This operation may take 12 to 24 hours to complete.
Check the logs and monitor progress in real time:
With the configuration below the Electrum server will be accessible only on localhost and on the Tor network. Refer to if you wish to also expose your node via IPv4/IPv6.
cookie_file: Electrs can use the Bitcoin JSON-RPC API with .