Raspberry Pi is a small single board computer that can be used to run a local Ethereum node. While many users operate nodes with cloud service providers, this can be expensive overtime, especially for full nodes of the mainnet, but Raspberry Pi has a low barrier to entry to get started with a local node setup. Raspberry Pi, and other single board computers, consume far less energy than a tradtional server or desktop machine and a Raspberry Pi's storage can be expanded through external hard drive solutions; NAS, RAID, and other external storage.
If you're having trouble determining the Raspberry Pi's IP address to SSH into it, then try using
nmap as explained here.
After completing Step 02, you should be able to remotely access the Raspberry Pi. Let's just call in an Ubuntu server for now. At this point the Ubuntu server is still fresh and requires some optimizations and software.
Update the operating system
sudo apt-get update && sudo apt-get upgrade
sudo apt install unzip
sudo snap install go --classic
sudo apt install make
sudo apt install htop
sudo apt-get install build-essential
View IP address
ip addr show
You may see a dynamic IP address (the same IP used to SSH) has been assigned to interface card "eth0". To make this IP address static, edit the netplan configuration file "/etc/netplan/50-cloud-init.yaml” using vim, nano, vi, or whatever terminal text editor you prefer.
network: ethernets: eth0: addresses: [192.168.1.144/24] gateway4: 192.168.1.1 nameservers: addresses: [22.214.171.124, 126.96.36.199] version: 2
Using your IP address and the example yaml file above. Edit /etc/netplan/50-cloud-init.yaml in vim
sudo vim /etc/netplan/50-cloud-init.yaml
i to enter insert mode to begin editing the text.
Esc to exit insert mode.
:wq to save the changes.
Apply the new netplan
sudo netplan apply
Check the changes were applied
ip addr show && ip route show
Storing the state of the blockchain requires more sufficient memory resources. Extending memory resources to the Raspberry Pi is quite simple since it has many USB ports to plug in an external HHD/ SSD, RAID, NAS, or whatever storage configuration you prefer.
It will be "/dev/sda". In many cases it's "/dev/sda" or "/dev/sda1", "/dev/sda2", etc...
List available disks
sudo fdisk -l
Create a partition for the disk.
sudo mkfs.ext4 /dev/sda
Mount the disk
sudo mkdir /mnt/ssd sudo chown -R ubuntu:ubuntu /mnt/ssd/ # "ubuntu" is the default hostname sudo mount /dev/sda /mnt/ssd # mount the disk "dev/sda" to "/mnt/ssd"
Get the unique ID of the disk (
/etc/fstab file, inserting the below example at the end of the file.
sudo vim /etc/fstab
UID=b2907e9d-1a37-4f26-8d43-b51ff3e1c66f /mnt/ssd ext4 defaults 0 0" at the end of the file with your disks UUID.
Check the disk was mounted
df -ha /dev/sda
Swap is a space on a disk that is used when the amount of physical RAM memory is full. Geth can consume a lot of memory during sync and setting up a Swap helps mitigate out-of-memory errors.
Clone the repo & change directory into the source
git clone https://github.com/etclabscore/core-geth.git && cd core-geth/
make geth # this may take a few minutes
Move the built
geth binary to the
sudo mv ~/core-geth/build/bin/geth /bin/
View usage and commands
Congrats Core-geth is installed!
By default, geth will store data in
~/.ethereum/geth/ on the microSD card, but you want to store data on the external disk space NOT the SD card.
--datadir <PATH> tells geth to use a specific directory (your external disk).
--cache <VALUE> tells geth to use a set amount of RAM in Megabytes. Since the device has 4 GB of RAM,
--cache 256 should mitigate out-of-memory errors, but might not be required if Swap memory is setup.
--syncmode fast tells geth to synchronise in fast mode.
It's best practice to name the directory based on the specific network to be run.
Make the data directory
sudo mkdir /mnt/ssd/ethereum/ # ethereum example sudo mkdir /mnt/ssd/classic/ # ethereum classic example
geth <commands> <datadirectory>
geth --syncmode fast --cache 256 --datadir /mnt/ssd/ethereum # ethereum geth --classic --syncmode fast --cache 256 --datadir /mnt/ssd/classic # ethereum classic
By default, Geth runs in the foreground of the terminal/ command prompt. To run geth in the background simply use
nohup in the beginning and
& at the end of the command. Example:
nohup geth --classic --syncmode fast --cache 256 --datadir /mnt/ssd/classic # ethereum classic &
Check geth process is running and current resource consumption using
Z to exit htop.
sudo geth attach ipc:/mnt/ssd/classic/geth.ipc # once entered in the geth console use "eth.syncing" to return current syncing status > eth.syncing # type "exit" to exit the geth console