Difference between revisions of "Running a Bitcoin node on a Pi"

From Organic Design
(to include from rPi and bPi)
(No difference)

Revision as of 22:38, 4 December 2019

Running a bitcoin node is usually pretty straight forward, just download the latest version for your architecture from bitcoin.org/bin, unpack it and install it into the environment as follows. Note that here I'm running under user and group "bitcoin", it's good practice to create a dedicated unprivileged user for it.

wget https://bitcoin.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-arm-linux-gnueabihf.tar.gz
tar -zxf bitcoin-0.19.0.1-arm-linux-gnueabihf.tar.gz
install -m 0755 -o bitcoin -g bitcoin -t /usr/local/bin bitcoin-0.19.0.1/bin/*


Most likely you're running off a small primary drive or even an SD card, in which case you'll need to ensure that the .bitcoin data directory for your bitcoin user is actually located on a large external drive since the blockchain (even if running a pruning node) will be very large. A symlink won't work for this, so you need to use a binding mount (both source and target must already exist), e.g

mount --bind /mnt/usb-drive/bitcoin/ /home/bitcoin/.bitcoin

Alternatively you can provide the -prune parameter when you start the service set to a certain number of megabytes to keep the stored block storage below your target value.


And then finally start bitcoin in daemon mode, if you have low memory like just 1GB, then you'll need a few extra parameters to keep the memory foot print down, the following example keeps it down to about 400M of RAM usage. And don't forget to use sudo to run it under your dedicated user. If you're behind a firewall you'll need to edit your bitcoin.conf and set listen to 0 and addnode to the IP of another node you know and trust on port 8333.

sudo -u bitcoin bitcoind -daemon -blocksonly=1 -dbcache=50 -maxorphantx=10 -maxmempool=100

Use bitcoind --help for details about the parameters and other options.