A noob-friendly step-by-step guide for selecting the hardware, configuring and running a Raspberry Pi, and configuring and running a Bitcoin full node with a focus on setting it up with enhanced privacy. This is meant for people who have limited or no experience with a Linux/UNIX-style operating system. I do my best to explain what each command is doing and why we're doing it.
Each step is outlined in a short YouTube video. This format allows me to easily insert changes when needed and avoid onerous video editing. The master playlist is here.
This project can be completed in a couple of nights or over a weekend.
twitter: @KeithMukai
- Quick Intro
- Recommended hardware list
- Vilros Raspberry Pi 4 w/4GB RAM kit
- Case w/fan
- USB-C power supply
- Eletung or StarTech SATA-to-USB 3.0 adapter
- Samsung 860 EVO 500GB (or bigger) SSD
- Any microSD card and microSD card adapter
- Wiring the case fan
- Wired vs wifi connection
- Game Plan: Boot from the SSD
- Note: Must use a compatible SATA-to-USB 3.0 adapter
- SSD Selection
- SD Card (non)Selection
main resource: James A Chambers blog: Raspberry Pi 4 USB Boot Config Guide for SSD / Flash Drives
- Getting Started
- Selecting Raspbian Package
- Using an older Raspbian release
- Verifying your download with SHA256 checksum
- Writing Raspbian to the SD card
- Writing Raspbian to the SSD
- Create empty "ssh" file
- Windows: from the terminal run
bash -c "touch ssh"
. And then copy the "ssh" file to the external drive called "boot".
- Windows: from the terminal run
- Booting up the Pi
- Following James A Chambers' procedure
- Connecting to the Pi: Intro to SSH
- Default
pi
user's password: "raspberry". - Windows users: You can use cmd.exe or PowerShell. You'll probably need to omit the ".local".
- Mac:
ssh pi@raspberrypi.local
- Win:
ssh pi@raspberrypi
- Mac:
- If the ssh command can't find the raspi, you may have to log in to your router to get the list of connected devices. Find the device named "raspberrypi" and ssh using the listed IP address (e.g.
ssh pi@192.168.1.103
).
- Default
- Find the PARTUUID for the SD card and SSD
- Edit /boot/cmdline.txt
- Explanation + safe reboot
- SSH warning
- Windows users should consult this info
- Updating fstab
- Resizing the filesystem for the SSD
- resize2fs on the SSD
- Hardware setup wrapup
- Change the default "pi" password
- Create your own user
- Adding user to sudo group
- Update Raspbian, pt1
- Update Raspbian, pt2
- Update the Pi's firmware
- see James A Chamber's blog: Raspberry Pi 4 Bootloader Firmware Updating / Recovery Guide
main resource: Raspnode
- Enlarge swap file
- Install Bitcoin dependencies, pt1
- Install Bitcoin dependencies, pt1
- Building the Berkeley DB, pt1
- Building the Berkeley DB, pt2
- Cloning the Bitcoin source code, setting up the compile
- Compiling Bitcoin!
- Install Bitcoin
- Run bitcoind for the first time
- Create the bitcoin.conf file
- note: The max dbcache might be 1024 so it's probably ignoring any value higher than that.
- Install Supervisor
- Configure Supervisor to manage bitcoind
- UPDATE: no need to capture the stdout logs (what would normally get displayed in the terminal) as all that info is written to ~/.bitcoin/debug.log. So we just write stdout to "/null/dev" which purges it into the abyss.
- UPDATE: the "-datadir=" is necessary. Without it bitcoind will look for the .bitcoin directory at "/.bitcoin" which would be at the disk root rather than within your user's "/home/youruser/" directory.
- Configuration file (update
youruser
accordingly):
[program:bitcoind] user=youruser command=bitcoind -datadir=/home/youruser/.bitcoin autostart=true autorestart=true stopwaitsecs=600 stderr_logfile=/home/youruser/.bitcoin/err.log stdout_logfile=/dev/null
- Install Tor
- Configure Tor
- Restart Tor service
- Adding user to Tor's debian-tor group
- bitcoind and outgoing connections through Tor
- bitcoind and incoming connections from Tor
- Complete incoming/outgoing Tor settings
- Tor wrapup; update bitcoin.conf
- Recommended: set txindex=1
- txindex=1 follow-up
- Configure logrotate
- Rename your Pi's hostname
- Check the Pi's CPU and RAM load (no video yet)
- Just run
htop
- Just run
- Check the Pi's temperature (no video yet)
- Add the "video" group to your user (customize "youruser"):
sudo usermod -aG video youruser
- Get the current temperature:
vcgencmd measure_temp
- Add the "video" group to your user (customize "youruser"):
- Expect "unexpected version" warning