Author

Topic: [BitcoinTalk Node Tutorial #2] Installing Electrs from source (Read 109 times)

sr. member
Activity: 406
Merit: 896
Links to other tutorials from the series:
[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalksearch.org/topic/bitcointalk-node-tutorial-1-running-bitcoin-core-on-raspbian-lite-gui-less-5476754
[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalksearch.org/topic/bitcointalk-node-tutorial-3-sparrow-terminal-infinite-whirlpool-mixes-5470024
[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalksearch.org/topic/bitcointalk-node-tutorial-4-connecting-bisq-to-our-node-5478756
[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalksearch.org/topic/bitcointalk-node-tutorial-5-hosting-a-monero-node-on-the-same-machine-5480371

Size required on disk:
Code:
$ sudo du -sh /media/apogio/BTC/electrs
42G /media/apogio/BTC/electrs



Installing Electrs from source

We have to download the sources from github: https://github.com/romanz/electrs

In order to do this, we need some packages, which we will install using the following command:
Code:
sudo apt install cargo clang cmake git curl

Then, we will download the sources for Electrs in our home directory:
Code:
cd ~
git clone https://github.com/romanz/electrs.git

We need to run the following command to install electrs:
Code:
cargo build --locked --release

This will take a while...

Now that the installation is finished, I want to run the electrs executable which is located in the path: ~/electrs/target/release/electrs. However, I want to be able to run it from everywhere, so I will move it where the bitcoin core binaries are:
Code:
mv ~/electrs/target/release/electrs /usr/local/bin

Now we must create a directory in our external SSD, alongside our bitcoincore directory.
Code:
mkdir /media/apogio/BTC/electrs

We will create a configuration file (electrs.conf) inside this directory.
Code:
cd /media/apogio/BTC/electrs
nano electrs.conf

At this point, we need to specify some details in our configuration file.
Code:
network="bitcoin"
auth=":"
daemon_dir="/media/apogio/BTC/bitcoincore"
db_dir="/media/apogio/BTC/electrs/db"
daemon_rpc_addr="127.0.0.1:8332"
daemon_p2p_addr="127.0.0.1:8333"
electrum_rpc_addr="127.0.0.1:50001"
index_lookup_limit=1000
log_filters="INFO"
timestamp=true

Notice that I have set log_filters level to INFO and not DEBUG but if I need more information I will change it.

Now it is time to run electrs using the following command:
Code:
electrs --conf /media/apogio/BTC/electrs/electrs.conf

After it is finished, the electrum server will be running on port 50001.

Jump to: