Lisa
mrcisme

Acknowledgements
Overview
Lisa is a *very* minimal ETH2 Validator running Geth (execution client) and Prysm (consensus client) for the Goerli Test Network.
Specs
I have a Raspberry Pi 4 Model B version. I found this out because the RAM Chip reads 'D9ZCL'. If you don't know what model you have, no worries, there are various ways to find out here!
- 8GB of RAM
- 1 TB SSD (Samsung Portable SSD T5)
- Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
Environment Setup
We need to boot from SSD, not microSD. Therefore, open the raspberry pi imager:
- Choose os > misc utility images > Bootloader > USB Boot Choose storage > Select your MicroSD card and click 'Write'
Remove the microSD card, insert into the rpi, turn the power on and the usb bootloader will flash automatically, the green light should blink steadily once the bootloader has flashed successfully. If you have a monitor you should see a green screen once the firmware is flashed.
- Launch the Pi Imager and click Choose OS Other General Purpose OS >Ubuntu > Ubuntu 22.04.1 LTS 64-bit server OS for arm 64 architectures. Choose the SSD Card for Storage and Click Write
- Launch the Pi imager and click Choose OS Raspberry Pi OS (32 bit) Choose storage > select micro sd card > write
Your Raspberry Pi should now boot from the SSD which is running Ubuntu. Connect your Rpi to a monitor and enable ssh (usually openssh is pre-installed) 'sudo apt update' 'sudo apt install openssh-server' verify it is enabled with: 'sudo systemctl status ssh'
- Connect your Rpi to internet router and find the IP address with fing, angry ip scanner, or Spectrum/Comcast app
- Open terminal on your computer
- ssh ubuntu@IPADDRESS
- sudo adduser USERNAME
- sudo usermod -aG sudo USERNAME
- id USERNAME (check if USERNAME is in the sudo group)
- sudo rsync --archive --chown=USERNAME:USERNAME ~/.ssh /home/USERNAME
- su - USERNAME
Updates and Security
- sudo apt -y update && sudo apt -y upgrade
- sudo apt dist-upgrade && sudo apt autoremove
- sudo reboot
- ssh USERNAME@IPADDRESS
- sudo ss -tulpn | grep ':6673'
- sudo nano /etc/ssh/sshd_config
- sudo systemctl restart sshd
- logout
- ssh USERNAME@IPADDRESS -p 6673
- sudo apt install ufw (should already be installed)
- sudo ufw default deny incoming
- sudo ufw default allow outgoing
- sudo ufw allow 6673/tcp
- sudo ufw deny 22/tcp
- sudo ufw allow 30303
- sudo ufw allow 13000/tcp
- sudo ufw allow 12000/udp
- sudo ufw allow 3000/tcp
- sudo ufw enable
- sudo ufw status numbered
- logout
- ssh USERNAME@IPADDRESS -p 6673
Create Swap Space
This is used in case mem gets low and it will guard against mem errors
- free -h
- df -h
- sudo fallocate -l 3G /swapfile
- sudo chmod 600 /swapfile
- sudo mkswap /swapfile
- sudo swapon /swapfile
- free -h
- sudo cp /etc/fstab /etc/fstab.bak
- echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
- sudo sysctl vm.swappiness=10
- sudo sysctl vm.vfs_cache_pressure=50
- sudo nano /etc/sysctl.conf
- vm.swappiness=10
- vm.vfs_cache_pressure = 50
- htop
- timedatectl
- sudo timedatectl set-ntp on
Generate the client authentication secret
On our server, communication between the execution and consensus clients is secured using JSON Web Tokens authentication scheme. The JWT is represented by a file that contains a randomly generated 32-byte hex string. This file is used for message Auth - create a directory on the server to store the JWT file
- sudo mkdir -p /var/lib/jwtsecret
- openssl rand -hex 32 | sudo tee /var/lib/jwtsecret/jwt.hex >/dev/null
- sudo nano /var/lib/jwtsecret/jwt.hex
Generate staking data
- cd ~
- curl -LO https://github.com/ethereum/staking-deposit-cli/releases/download/v2.3.0/staking_deposit-cli-76ed782-linux-arm64.tar.gz
- tar -xvf staking_deposit-cli-76ed782-linux-arm64.tar.gz
- rm staking_deposit-cli-76ed782-linux-arm64.tar.gz
- cd staking_deposit-cli-76ed782-linux-arm64
- ls
- sudo ./deposit new-mnemonic --num_validators 1 --chain goerli
Install the Execution Client (Geth)
You can choose any client you would like, but I am going to use Geth because I am familiar with it
- cd ~
- curl -LO https://gethstore.blob.core.windows.net/builds/geth-linux-arm64-1.10.25-69568c55.tar.gz
- tar -xvf geth-linux-arm64-1.10.25-69568c55.tar.gz
- rm geth-linux-arm64-1.10.25-69568c55.tar.gz
- cd geth-linux-arm64-1.10.25-69568c55/
- sudo cp geth /usr/local/bin
- sudo useradd --no-create-home --shell /bin/false geth
- sudo mkdir -p /var/lib/geth
- sudo chown -R geth:geth /var/lib/geth
- sudo nano /etc/systemd/system/geth.service
[Unit] Description=Geth Execution Client (Goerli Test Network) After=network.target Wants=network.target [Service] User=geth Group=geth Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/geth \ --goerli \ --datadir /var/lib/geth \ --authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex \ --metrics \ --metrics.addr 127.0.0.1 [Install] WantedBy=default.target
Notes
- The path to the JWT file ( authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex ) is required for authenticated communication between the Execution and Consensus clients. It enables the Engine API RPC endpoint. Setting this will expose an authenticated HTTP endpoint (http://127.0.0.1:8551). Also "metrics.addr 127.0.0.1" enables the metrics HTTP server.
- sudo systemctl daemon-reload
- sudo systemctl start geth
- sudo systemctl status geth
- sudo journalctl -fu geth
- ^c to exit
- sudo systemctl enable geth
Install the Consensus Client (Prysm)
The Prysm Consensus Client is made up of two binaries that provide the functionality of the beacon node and validator, respectively. This step will download and prepare the Prysm binaries. Make sure to copy the arm64 version, the beacon chain and the validator file like so:
- curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v3.1.1/beacon-chain-v3.1.1-linux-arm64
- curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v3.1.1/validator-v3.1.1-linux-arm64
- mv beacon-chain-v3.1.1-linux-arm64 beacon-chain
- mv validator-v3.1.1-linux-arm64 validator
- chmod +x beacon-chain
- chmod +x validator
- sudo cp beacon-chain /usr/local/bin
- sudo cp validator /usr/local/bin
Import the Validator Keys
Configure the Prysm validator client to use the validator keys that were generated earlier We need to import the keys we generated in step 8 into the validator client- the validator will use these keys to sign blocks and attestations on the beacon chain.
- sudo mkdir -p /var/lib/prysm/validator
- sudo chown -R yourusername:yourusername /var/lib/prysm/validator
- /usr/local/bin/validator accounts import --keys-dir=$HOME/staking-deposit-cli/validator_keys --wallet-dir=/var/lib/prysm/validator --goerli
- sudo /usr/local/bin/validator accounts import --keys-dir=$HOME/staking-deposit-cli/validator_keys --wallet-dir=/var/lib/prysm/validator --goerli
- sudo nano /var/lib/prysm/validator/password.txt
Configure the Beacon node service
In this step you will configure and run the Prysm beacon node as a service so if the system restarts the process will automatically start back up again.Notable flags: 'http-web3provider=http://127.0.0.1:8551' The address of the Execution Client. Should be the same for all Execution Clients detailed in this guide. 'jwt-secret=/var/lib/jwtsecret/jwt.hex'. The path to the JWT file that is required for authenticated communication between the Execution and Consensus clients. 'suggested-fee-recipient=FeeRecipientAddress'- Validators can receive tips from user transactions. Provide an Ethereum address within your control to specify where the tips should go.Enables the Checkpoint Sync feature to greatly speed up the Beacon Chain Node sync: --enable-debug-rpc-endpoints --grpc-max-msg-size=6568081 --checkpoint-sync-url=https://goerli.checkpoint-sync.ethdevops.io --genesis-beacon-api-url=https://goerli.checkpoint-sync.ethdevops.ioReload Systemd to reflect the changes:
- sudo useradd --no-create-home --shell /bin/false prysmbeacon
- sudo mkdir -p /var/lib/prysm/beacon
- sudo chown -R prysmbeacon:prysmbeacon /var/lib/prysm/beacon
- sudo nano /etc/systemd/system/prysmbeacon.service
[Unit] Description=Prysm Consensus Client BN (Goerli Test Network) Wants=network-online.target After=network-online.target [Service] User=prysmbeacon Group=prysmbeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/beacon-chain \ --goerli \ --datadir=/var/lib/prysm/beacon \ --http-web3provider=http://127.0.0.1:8551 \ --jwt-secret=/var/lib/jwtsecret/jwt.hex \ --suggested-fee-recipient=FeeRecipientAddress \ --enable-debug-rpc-endpoints \ --grpc-max-msg-size=65568081 \ --checkpoint-sync-url=https://goerli.checkpoint-sync.ethdevops.io \ --genesis-beacon-api-url=https://goerli.checkpoint-sync.ethdevops.io \ --accept-terms-of-use [Install] WantedBy=multi-user.target
⚠️Make sure to replace FeeRecipientAddress ⚠️- sudo systemctl daemon-reload
- sudo systemctl start prysmbeacon
- sudo systemctl status prysmbeacon
- sudo journalctl -fu prysmbeacon
- sudo systemctl enable prysmbeacon
- sudo geth attach --datadir /var/lib/geth
- eth.syncing
Configure the Validator Service
Create an account for the validator node to run under. This type of account can't log into the server.- sudo useradd --no-create-home --shell /bin/false prysmvalidator
- sudo chown -R prysmvalidator:prysmvalidator /var/lib/prysm/validator
- sudo chown -R prysmvalidator:prysmvalidator /var/lib/prysm/validator
- sudo nano /etc/systemd/system/prysmvalidator.service
[Unit] Description=Prysm Consensus Client VC (Goerli Test Network) Wants=network-online.target After=network-online.target [Service] User=prysmvalidator Group=prysmvalidator Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/validator \ --datadir=/var/lib/prysm/validator \ --wallet-dir=/var/lib/prysm/validator \ --wallet-password-file=/var/lib/prysm/validator /password.txt \ --graffiti="yourgraffiti" \ --accept-terms-of-use [Install] WantedBy=multi-user.target
- sudo systemctl daemon-reload
- sudo systemctl start prysmvalidator
- sudo systemctl status prysmvalidator
- sudo journalctl -fu prysmvalidator
- sudo systemctl enable prysmvalidator
Fund the Validator Keys
I decided to run the deposit cli on my ubuntu server and then SFTP using filezilla to transfer the deposit data to my mac. IF you have never done this - read this. Also your permissions for /staking-deposit-cli/validator_keys/ may be wrong so:Go here: https://goerli.launchpad.ethereum.org/ Click through the steps and upload your depost data Connect your wallet with 32 Goerli ETH Send the deposit! This will take 15 hours so we'll check tomorrow
- sudo chown USERNAME /path/to/validator_keys
Congrats 🎉
Helpful Links
Guide to Staking on Ethereum (Ubuntu/Goerli/Prysm)
Spin up your own Eth 2.0 test node on Linux - EthDocker
EthStaker Discord