Bitcoin Forum
May 10, 2024, 08:32:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [BitcoinTalk Node Tutorial #2] Installing Electrs from source  (Read 109 times)
apogio (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 966



View Profile WWW
December 10, 2023, 06:14:05 PM
Last edit: January 09, 2024, 01:59:56 PM by apogio
Merited by LoyceV (8), RickDeckard (4), Husna QA (2), Cricktor (1)
 #1

Links to other tutorials from the series:
[BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) https://bitcointalk.org/index.php?topic=5476754.0
[BitcoinTalk Node Tutorial #3] Sparrow terminal / infinite Whirlpool mixes https://bitcointalk.org/index.php?topic=5470024.0
[BitcoinTalk Node Tutorial #4] Connecting BISQ to our node https://bitcointalk.org/index.php?topic=5478756.0
[BitcoinTalk Node Tutorial #5] Hosting a Monero node on the same machine https://bitcointalk.org/index.php?topic=5480371.0

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="<user>:<pass>"
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.


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!