electrsSince one of the main benefits of running a full node is privacy during transaction & address lookup, an Electrum server is needed. Otherwise you'd have to query using Bitcoin Core all the time and can't just use your mobile and desktop applications for that.
[1] Install dependencies, make sure you're logged into your sudoer account and not in
bitcoin.
sudo zypper install clang cargo rust tor
[2] Download and build electrs as
bitcoin. It took my machine around 10 minutes.
su - bitcoin
git clone https://github.com/romanz/electrs
cd electrs
cargo build --locked --release --no-default-features
mkdir database
[3] Create electrs config file
[code]
nano electrs.toml
[4] Enter the following:
cookie_file = "/home/bitcoin/.bitcoin/.cookie"
# The listening RPC address of bitcoind, port is usually 8332
daemon_rpc_addr = "127.0.0.1:8332"
# The listening P2P address of bitcoind, port is usually 8333
daemon_p2p_addr = "127.0.0.1:8333"
# Directory where the index should be stored. It should have at least 70GB of free space.
db_dir = "/home/bitcoin/electrs/database"
# bitcoin means mainnet. Don't set to anything else unless you're a developer.
network = "bitcoin"
# How much information about internal workings should electrs print. Increase before reporting a bug.
verbose = 2
[5] Log back out into your sudo account, and open the Tor config file.
exit
sudo nano /etc/tor/torrc
[6] Add the following contents, preferably in the right section (somewhere where there's
HiddenServiceDir stuff commented out).
HiddenServiceDir /var/lib/tor/electrs_hidden_service/
HiddenServiceVersion 3
HiddenServicePort 50001 127.0.0.1:50001
ExitPolicy reject *:* # no exits allowed
[7] Start up Tor and fetch your electrs Tor hostname. The hostname can then be entered in wallets like Wasabi and BlueWallet settings.
sudo systemctl restart tor
sudo cat /var/lib/tor/electrs_hidden_service/hostname
[8] Create a service so electrs starts on startup
sudo nano /usr/lib/systemd/system/electrs.service
[9] Enter this information
[Unit]
Description=Electrs
After=bitcoind.service
[Service]
WorkingDirectory=/home/bitcoin/electrs
ExecStart=/home/bitcoin/electrs/target/release/electrs
User=bitcoin
Group=users
Type=simple
KillMode=process
TimeoutSec=60
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target
[10] Start the service
sudo systemctl enable electrs.service
sudo service electrs start
[11] Check that it's running. This should return the electrs version.
echo '{"jsonrpc": "2.0", "method": "server.version", "params": ["", "1.4"], "id": 0}' | netcat 127.0.0.1 50001
[/code]