How to turn your Raspberry Pi 4 into a node just by flashing the MicroSD card
Ethereum on Arm is a custom Linux image that can turn a Raspberry Pi into an Ethereum node.
To use Ethereum on Arm to turn a Raspberry Pi into an Ethereum node, the following hardware is recommended:
- Raspberry 4 (model B 8GB), Odroid M1 or Rock 5B (8GB/16GB RAM) board
- MicroSD Card (16 GB Class 10 minimum)
- 2 TB SSD minimum USB 3.0 disk or an SSD with a USB to SATA case.
- Power supply
- Ethernet cable
- Port forwarding (see clients for further info)
- A case with heatsink and fan
- USB keyboard, Monitor and HDMI cable (micro-HDMI) (Optional)
Why run Ethereum on ARM?
ARM boards are very affordable, flexible, small computers. They are good choices for running Ethereum nodes because they can be bought cheaply, configured so that all their resources focus just on the node, making them efficient, they consume low amounts of power and have are physically small so they can fit unobtrusively in any home. It is also very easy to spin up nodes because the Raspberry Pi's MicroSD can simply be flashed with a prebuilt image, with no downloading or building software required.
How does it work?
The Raspberry Pi's memory card is flashed with a prebuilt image. This image contains everything needed to run an Ethereum node. With a flashed card, all the user needs to do is power-on the Raspberry Pi. All the processes required to run the node are automatically started. This works because the memory card contains a Linux-based operating system (OS) on top of which system-level processes are automatically run that turn the unit into an Ethereum node.
Ethereum cannot be run using the popular Raspberry Pi Linux OS "Raspbian" because Raspbian still uses a 32-bit architecture which leads Ethereum users to run into memory issues and consensus clients do not support 32-bit binaries. To overcome this, the Ethereum on Arm team migrated to a native 64-bit OS called "Armbian".
Images take care of all the necessary steps, from setting up the environment and formatting the SSD disk to installing and running the Ethereum software as well as starting the blockchain synchronization.
Note on execution and consensus clients
The Ethereum on Arm image includes prebuilt execution and consensus clients as services. An Ethereum node requires both clients to be synced and running. You are only required to download and flash the image and then start the services. The image is preloaded with the following execution clients:
and the following consensus clients:
You should choose one of each to run - all execution clients are compatible with all consensus clients. If you do not explicitly select a client, the node will fall back to its defaults - Geth and Lighthouse - and run them automatically when the board is powered up. You must open port 30303 on your router so Geth can find and connect to peers.
Downloading the Image
The Raspberry Pi 4 Ethereum image is a "plug and play" image that automatically installs and sets up both the execution and consensus clients, configuring them to talk to each other and connect to the Ethereum network. All the user needs to do is start their processes using a simple command.
Download the Raspberry Pi image from Ethereum on Arm(opens in a new tab) and verify the SHA256 hash:
1# From directory containing the downloaded image2shasum -a 256 ethonarm_22.04.00.img.zip3# Hash should output: fb497e8f8a7388b62d6e1efbc406b9558bee7ef46ec7e53083630029c117444f4
Note that images for Rock 5B and Odroid M1 boards are available at the Ethereum-on-Arm downloads page(opens in a new tab).
Flashing the MicroSD
The MicroSD card that will be used for the Raspberry Pi should first be inserted into a desktop or laptop so it can be flashed. Then, the following terminal commands will flash the downloaded image onto the SD card:
1# check the MicroSD card name2sudo fdisk -l34>> sdxxx5
It is really important to get the name correct because the next command includes
dd which completely erases the existing content of the card before pushing the image onto it. To continue, navigate to the directory containing the zipped image:
1# unzip and flash image2unzip ethonarm_22.04.00.img.zip3sudo dd bs=1M if=ethonarm_22.04.00.img of=/dev/<sdxx> conv=fdatasync status=progress4
The card is now flashed, so it can be inserted into the Raspberry Pi.
Start the node
With the SD card inserted into the Raspberry Pi, connect the ethernet cable and SSD then switch the power on. The OS will boot up and automatically start performing the preconfigured tasks that turn the Raspberry Pi into an Ethereum node, including installing and building the client software. This will probably take 10-15 minutes.
Once everything is installed and configured, log in to the device via an ssh connection or using the terminal directly if a monitor and keyboard is attached to the board. Use the
ethereum account to log in, as this has permissions required to start the node.
1User: ethereum2Password: ethereum3
The default execution client, Geth, will start automatically. You can confirm this by checking the logs using the following terminal command:
1sudo journalctl -u geth -f2
The consensus client does need to be started explicitly. To do this, first open port 9000 on your router so that Lighthouse can find and connect to peers. Then enable and start the lighthouse service:
1sudo systemctl enable lighthouse-beacon2sudo systemctl start lighthouse-beacon3
Check the client using the logs:
1sudo journalctl -u lighthouse-beacon2
Note that the consensus client will sync in a few minutes because it uses checkpoint sync. The execution client will take longer - potentially several hours, and it will not start until the consensus client is already finished syncing (this is because the execution client needs a target to sync to, which the synced consensus client provides).
Geth is preconfigured to report metrics to a Grafana dashboard which can be viewed in the browser. More advanced users might wish to use this feature to monitor the health of their node by navigating to
user: admin and
A validator can also be optionally added to the consensus client. The validator software allows your node to participate actively in consensus and provides the network with cryptoeconomic security. You get rewarded for this work in ETH. To run a validator, you must first have 32 ETH, which must be deposited into the deposit contract. This is a long-term commitment - it is not yet possible to withdraw this ETH!. The deposit can be made by following the step-by-step guide on the Launchpad(opens in a new tab). Do this on a desktop/laptop, but do not generate keys — this can be done directly on the Raspberry Pi.
Open a terminal on the Raspberry Pi and run the following command to generate the deposit keys:
1sudo apt-get update2sudo apt-get install staking-deposit-cli3cd && deposit new-mnemonic --num_validators 14
Keep the mnemonic phrase safe! The command above generated two files in the node's keystore: the validator keys and a deposit data file. The deposit data needs to be uploaded into the launchpad, so it must be copied from the Raspberry Pi to the desktop/laptop. This can be done using an ssh connection or any other copy/paste method.
Once the deposit data file is available on the computer running the launchpad, it can be dragged and dropped onto the
+ on the launchpad screen. Follow the instructions on the screen to send a transaction to the deposit contract.
Back on the Raspberry Pi, a validator can be started. This requires importing the validator keys, setting the address to collect rewards, and then starting the preconfigured validator process. The example below is for Lighthouse—instructions for other consensus clients are available on the Ethereum on Arm docs(opens in a new tab):
1# import the validator keys2lighthouse account validator import --directory=/home/ethereum/validator_keys34# set the reward address5sudo sed -i 's/<ETH_ADDRESS>' /etc/ethereum/lighthouse-validator.conf67# start the validator8sudo systemctl start lighthouse-validator9
Congratulations, you now have a full Ethereum node and validator running on a Raspberry Pi!
This page gave an overview of how to set up a Geth-Lighthouse node and validator using Raspberry Pi. More detailed instructions are available on the Ethereum-on-Arm website(opens in a new tab).
We know the Raspberry Pi has a massive user base that could have a very positive impact on the health of the Ethereum network. Please dig into the details in this tutorial, try running on testnets, check out the Ethereum on Arm GitHub, give feedback, raise issues and pull requests and help advance the technology and documentation!
- https://ubuntu.com/download/raspberry-pi(opens in a new tab)
- https://wikipedia.org/wiki/Port_forwarding(opens in a new tab)
- https://prometheus.io(opens in a new tab)
- https://grafana.com(opens in a new tab)
- https://forum.armbian.com/topic/5565-zram-vs-swap/(opens in a new tab)
- https://geth.ethereum.org(opens in a new tab)
- https://nethermind.io(opens in a new tab)
- https://www.hyperledger.org/projects/besu(opens in a new tab)
- https://github.com/prysmaticlabs/prysm(opens in a new tab)
- https://lighthouse.sigmaprime.io(opens in a new tab)
- https://ethersphere.github.io/swarm-home(opens in a new tab)
- https://raiden.network(opens in a new tab)
- https://ipfs.io(opens in a new tab)
- https://status.im(opens in a new tab)
- https://vipnode.org(opens in a new tab)
Nazadnje urejeno: , Invalid DateTime