Saturday, December 14, 2019

Guide to running bitcoind on a Raspberry Pi 4 (4gb ram) on an external hard drive

I have seen a lot of guides online but for a few reasons I thought it'd be good to share how I set up my full node (with relatively few headaches) and less than $150.

Stuff to get

  1. Raspberry Pi 4 (4gb ram is essential!) - $55
  2. Power cable for the raspberry pi - $10
  3. Case for the raspberry pi - $5 (optional, looks good and makes it easier to store)
  4. microHDMI to HDMI cable (needed to view desktop of raspberry pi) - $10
  5. SD Card, at least 8GB - ~$10+ (PS: you may also need a converter to read/write from your PC to the SD card).
  6. External hard drive, ideally at least a 1TB - $50+

Setup the Raspberry pi

  1. Download NOOBS and unzip it to SD card, and insert the SD card into the Raspberry Pi.
  2. Insert the SD card into the Raspberry Pi, and place the Raspberry Pi into its case. Connect the relevant cables, and plug in the power to the Raspberry Pi.
  3. Follow the instructions on screen to get Raspian up and running.

Configuring the External Hard Drive

  1. Turn off automount
  2. Configure the raspberry pi to mount the external hard drive where you want it. See this page on how to configure external hard drives for Raspberry Pis.

Download and configure bitcoin-core

  1. Go to bitcoin.org and download bitcoin-core.
  2. Follow the instructions here and install bitcoin-core.
  3. Create a directory called .bitcoin from the home directory.
  4. Create a file called bitcoin.conf in ~/.bitcoin. Add the following settings to it to ensure that you can process historical transactions:

server=1 txindex=1 rpcuser=<username> rpcpassword=<password> datadir=<path-on-external-harddrive> dbcache=2500 

Run bitcoind

  1. From the command line, run bitcoind -daemon
  2. Now you can run bitcoin-cli -getinfo or tail <path-on-external-harddrive>/debug.log to get info on how bitcoind is doing.

That should do it. Assuming a solid internet connection, you should be up and running relatively quickly (less than a day). If you need help, feel free to ask questions below. I'd be happy to help.



No comments:

Post a Comment