Author

Topic: [BitcoinTalk Node Tutorial #1] Running Bitcoin Core on Raspbian Lite (GUI-less) (Read 219 times)

hero member
Activity: 560
Merit: 1060
There's no need to end a line with a semi colon. That's only needed to separate commands on the same line.

Sure, it's just a habit from programming in Java  Tongue


In case there is no "Downloads" directory yet:
Code:
mkdir -p ~/Downloads/Core
cd ~/Downloads/Core


Good catch. Adding it now.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Code:
cd ~/Downloads; 
mkdir Core;
cd Core;
There's no need to end a line with a semi colon. That's only needed to separate commands on the same line.

In case there is no "Downloads" directory yet:
Code:
mkdir -p ~/Downloads/Core
cd ~/Downloads/Core
hero member
Activity: 560
Merit: 1060
Links to other tutorials from the series:
[BitcoinTalk Node Tutorial #2] Installing Electrs from source https://bitcointalksearch.org/topic/bitcointalk-node-tutorial-2-installing-electrs-from-source-5477339
[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/bitcoincore
627G /media/apogio/BTC/bitcoincore



I will create a series of posts (at my own slow pace).
In this series, I will create a custom Bitcoin Node on a GUI-less OS.
I will add various features on this node.

I encourage all of you to share your thoughts and suggestions. In fact, some decisions will be determined by your suggestions.

Hardware / Software used in the series
ComputerRaspberry Pi 4b 8GB RAM
SoftwareRaspberry Pi OS Lite (64-bit)
Storage2TB external SSD



Installing and running Bitcoin Core on Raspbian Lite

Downloading Bitcoin Core

Firstly, we create a directory on the home path, where we will download the necessary packages, let's say we create it inside the Downloads directory:
Code:
mkdir -p ~/Downloads/Core
cd ~/Downloads/Core

Now, the latest version is 25.1, so the following command will download the core software and the checksum in our directory:
Code:
wget https://bitcoincore.org/bin/bitcoin-core-25.1/bitcoin-25.1-aarch64-linux-gnu.tar.gz
wget https://bitcoincore.org/bin/bitcoin-core-25.1/SHA256SUMS

Let's check whether the checksum is correct:
Code:
sha256sum --ignore-missing --check SHA256SUMS

So, now we must extract the installer from the tarball:
Code:
tar -xvf bitcoin-25.1-aarch64-linux-gnu.tar.gz

Personally, I install my binaries in /usr/local/bin, so I will use the following command:
Code:
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-25.1/bin/*

We must be done, let's check:
Code:
bitcoind --version

We should receive a prompt that the version is 25.1.

Let's delete the directory we created to download the stuff we needed. It's no longer necessary:
Code:
cd ~;
rm -rf ~/Downloads/Core

Running Bitcoin Core

Most of the time, when the external storage is connected, it mounts to a specific filesystem location. Let's check where it is:
Code:
lsblk

This will return something like:
Code:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
...
sdb           8:16   0  1.9T  0 disk
`-sdb1      8:17   0  1.9T  0 part /media/apogio/BTC
...

From this, we can see that the external drive is mounted on /media/apogio/BTC. This will be our home directory for Bitcoin Core.

Let's create a configuration file and start Bitcoin Core:
Code:
cd /media/apogio/BTC
mkdir bitcoincore
nano bitcoin.conf

This will open up nano and create a file called bitcoin.conf inside the directory /media/apogio/BTC/bitcoincore.
The following lines are ok for the moment:
Code:
datadir=/media/apogio/BTC/bitcoincore
dbcache=5000
daemon=1
server=1

Now we are ready to go.

Let's run Bitcoin Core and wait until the IBD is finished:
Code:
bitcoind -conf=/media/apogio/BTC/bitcoincore/bitcoin.conf

This will take some days. So relax and let it work.

If at any time you wish to stop the daemon, just run:
Code:
bitcoin-cli --datadir=/media/apogio/BTC/bitcoincore stop

The IBD is finished, I will stop Bitcoin Core, and I will refresh my bitcoin.conf file as follows:

Code:
# basic directives
datadir=/media/apogio/BTC/bitcoincore

# bitcoin daemon
daemon=1
server=1
listen=1

# tor
proxy=127.0.0.1:9050
bind=127.0.0.1

# network
rpcuser=
rpcpassword=

[main]
rpcbind=127.0.0.1
rpcbind=
rpcallowip=127.0.0.1
rpcallowip=192.168.0.0/16

# optimimizations
maxconnections=30

Jump to: