Post
Topic
Board Development & Technical Discussion
Merits 7 from 4 users
Re: >> OpenSUSE 15.3 walkthrough: bitcoind + electrs + c-lightning + RTL <<
by
n0nce
on 21/10/2021, 13:12:52 UTC
⭐ Merited by NotATether (3) ,ETFbitcoin (2) ,Husna QA (1) ,JayJuanGee (1)
Bitcoin Core
[1] Install prerequisites:
Code:
sudo zypper -v install git python3 make automake autoconf gcc-c++ libtool libevent-devel libdb-4_8-devel
sudo zypper -v install libboost_filesystem-devel libboost_program_options-devel libboost_system-devel libboost_test-devel libboost_thread-devel

[2] Switch to unprivileged bitcoin user. Commands should output bitcoin (user) and /home/bitcoin (working directory)
Code:
su - bitcoin
whoami
pwd

[3] Download & build Bitcoin Core. v22.0 parameter needs to be adapted to the latest version whenever you read this guide.
Code:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v22.0
./autogen.sh
./configure
make -j $(nproc)

[4] Create random username and password to access core via RPC.
Code:
cd share/rpcauth/
python3 rpcauth.py the_username_of_the_user_you_want cleartext_password_unique_long

[4.1] Delete history, otherwise the password remains in history file in cleartext.
Code:
history -c
history -w

[5] Create Bitcoin config file
Code:
mkdir ~/.bitcoin
nano ~/.bitcoin/bitcoin.conf

[6] Fill it like follows:
Code:
daemon=1
server=1
maxmempool=50
mempoolexpiry=2
rpcauth=user_chose_in_step_4:hash_created_in_step_4
dbcache=2048
banscore=10
datadir=/home/bitcoin/.bitcoin/

[7] Exit back to admin account
Code:
exit

[8] Install Bitcoin
Code:
cd /home/bitcoin/bitcoin
sudo make install
cd

[9] Still logged in as sudoer, create Bitcoin service:
Code:
sudo nano /usr/lib/systemd/system/bitcoind.service

10) Contents should be like shown:
Code:
[Unit]
Description=Bitcoin daemon
After=network.target

[Service]
ExecStart=/usr/local/bin/bitcoind -daemon -conf=/home/bitcoin/.bitcoin/bitcoin.conf

# Make sure the config directory is readable by the service user
PermissionsStartOnly=true

# Process management
####################

Type=forking
Restart=on-failure

# Directory creation and permissions
####################################

# Run as bitcoin:bitcoin
User=bitcoin
Group=bitcoin

# Hardening measures
####################

# Provide a private /tmp and /var/tmp.
PrivateTmp=true

# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full

# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true

# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target

[11] Enable & start service
Code:
sudo systemctl enable bitcoind.service
sudo service bitcoind start

[12] Check if running
Code:
tail -f /home/bitcoin/.bitcoin/debug.log

[13] Exit with CTRL+C, now wait for many moons (or hours) for the IBD to finish.
To check on the progress, you may use the tail command from before again or check disk utilization.
Code:
du -h /home/bitcoin/.bitcoin/blocks

After initial block download is finished, bitcoin-cli getblockchaininfo should return
Code:
"verificationprogress": 0.9999999999,
"initialblockdownload": false