Supplementary Guide to Staking on Ethereum For Existing Stakers

  • JWT Authentication Token
  • A functioning Merge Ready Geth client (if you are using Geth)
  • A functioning Merge Ready Consensus Client

Disclaimer

Disk Space

JWT Authentication Token

$ sudo mkdir -p /var/lib/jwtsecret
$ openssl rand -hex 32 | sudo tee /var/lib/jwtsecret/jwt.hex > /dev/null

Execution Client

Geth

$ sudo systemctl stop geth
$ sudo apt remove -y geth
$ sudo add-apt-repository --remove ppa:ethereum/ethereum
$ cd ~
$ curl -LO https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.25-69568c55.tar.gz
$ tar xvf geth-linux-amd64-1.10.25-69568c55.tar.gz
$ cd geth-linux-amd64-1.10.25-69568c55
$ sudo cp geth /usr/local/bin
$ cd ~
$ rm geth-linux-amd64-1.10.25-69568c55.tar.gz
$ rm -r geth-linux-amd64-1.10.25-69568c55
$ sudo usermod -l geth goeth
$ sudo groupmod -n geth goeth
$ sudo mv /var/lib/goethereum /var/lib/geth
$ sudo chown -R geth:geth /var/lib/geth
$ sudo nano /etc/systemd/system/geth.service
[Unit]
Description=Geth Execution Client (Mainnet)
After=network.target
Wants=network.target
[Service]
User=geth
Group=geth
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/geth --mainnet --datadir /var/lib/geth --authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex
[Install]
WantedBy=default.target
$ sudo systemctl daemon-reload
$ sudo systemctl start geth
$ sudo journalctl -fu geth.service

Consensus Clients

Lighthouse

$ cd ~
$ curl -LO https://github.com/sigp/lighthouse/releases/download/v3.1.0/lighthouse-v3.1.0-x86_64-unknown-linux-gnu.tar.gz
$ sudo systemctl stop lighthousevalidator
$ sudo systemctl stop lighthousebeacon
$ tar xvf lighthouse-v3.1.0-x86_64-unknown-linux-gnu.tar.gz
$ sudo cp lighthouse /usr/local/bin
$ rm lighthouse-v3.1.0-x86_64-unknown-linux-gnu.tar.gz
$ rm lighthouse

Lighthouse Beacon Chain

$ sudo nano /etc/systemd/system/lighthousebeacon.service
[Unit]
Description=Lighthouse Consensus Client BN (Mainnet)
Wants=network-online.target
After=network-online.target
[Service]
User=lighthousebeacon
Group=lighthousebeacon
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/lighthouse bn --network mainnet --datadir /var/lib/lighthouse --http --execution-endpoint http://127.0.0.1:8551 --execution-jwt /var/lib/jwtsecret/jwt.hex
[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl start lighthousebeacon
$ sudo journalctl -fu lighthousebeacon

Lighthouse Validator

$ sudo nano /etc/systemd/system/lighthousevalidator.service
[Unit]
Description=Lighthouse Consensus Client VC (Mainnet)
Wants=network-online.target
After=network-online.target
[Service]
User=lighthousevalidator
Group=lighthousevalidator
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/lighthouse vc --network mainnet --datadir /var/lib/lighthouse --suggested-fee-recipient FeeRecipientAddress --graffiti "<yourgraffiti>"
[Install]
WantedBy=multi-user.target
ExecStart=/usr/local/bin/lighthouse vc --network mainnet --datadir /var/lib/lighthouse --suggested-fee-recipient 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --graffiti "Validatoor"
$ sudo systemctl daemon-reload
$ sudo systemctl start lighthousevalidator
$ sudo journalctl -fu lighthousevalidator

Nimbus

$ cd ~
$ curl -LO https://github.com/status-im/nimbus-eth2/releases/download/v22.9.0/nimbus-eth2_Linux_amd64_22.9.0_667c3c97.tar.gz
$ sudo systemctl stop nimbus
$ tar xvf nimbus-eth2_Linux_amd64_22.9.0_667c3c97.tar.gz
$ cd nimbus-eth2_Linux_amd64_22.9.0_667c3c97
$ sudo cp build/nimbus_beacon_node /usr/local/bin
$ cd ~
$ rm nimbus-eth2_Linux_amd64_22.9.0_667c3c97.tar.gz
$ rm -r nimbus-eth2_Linux_amd64_22.9.0_667c3c97
$ sudo nano /etc/systemd/system/nimbus.service
[Unit]
Description=Nimbus Consensus Client (Mainnet)
Wants=network-online.target
After=network-online.target
[Service]
User=nimbus
Group=nimbus
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/nimbus_beacon_node --network=mainnet --data-dir=/var/lib/nimbus --web3-url=http://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=FeeRecipientAddress --graffiti="<yourgraffiti>"
[Install]
WantedBy=multi-user.target
ExecStart=/usr/local/bin/nimbus_beacon_node --network=mainnet --data-dir=/var/lib/nimbus --web3-url=http://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --graffiti="Validatoor"
$ sudo systemctl daemon-reload
$ sudo systemctl start nimbus
$ sudo journalctl -fu nimbus

Prysm

$ cd ~
$ curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v3.1.1/beacon-chain-v3.1.1-linux-amd64
$ curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v3.1.1/validator-v3.1.1-linux-amd64
$ sudo systemctl stop prysmvalidator
$ sudo systemctl stop prysmbeacon
$ mv beacon-chain-v3.1.1-linux-amd64 beacon-chain
$ mv validator-v3.1.1-linux-amd64 validator
$ chmod +x beacon-chain
$ chmod +x validator
$ sudo cp beacon-chain /usr/local/bin
$ sudo cp validator /usr/local/bin
$ rm beacon-chain && rm validator

Prysm Beacon Chain

$ sudo nano /etc/systemd/system/prysmbeacon.service
[Unit]
Description=Prysm Consensus Client BN (Mainnet)
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 --mainnet --datadir=/var/lib/prysm/beacon --execution-endpoint=http://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=FeeRecipientAddress --accept-terms-of-use
[Install]
WantedBy=multi-user.target
ExecStart=/usr/local/bin/beacon-chain --mainnet --datadir=/var/lib/prysm/beacon --execution-endpoint=http://127.0.0.1:8551 --jwt-secret=/var/lib/jwtsecret/jwt.hex --suggested-fee-recipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --accept-terms-of-use
$ sudo systemctl daemon-reload
$ sudo systemctl start prysmbeacon
$ sudo journalctl -fu prysmbeacon

Prysm Validator

$ sudo nano /etc/systemd/system/prysmvalidator.service
[Unit]
Description=Prysm Consensus Client VC (Mainnet)
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 --suggested-fee-recipient=FeeRecipientAddress --graffiti="<yourgraffiti>" --accept-terms-of-use
[Install]
WantedBy=multi-user.target
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 --suggested-fee-recipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --graffiti="Validatoor" --accept-terms-of-use
$ sudo systemctl daemon-reload
$ sudo systemctl start prysmvalidator
$ sudo journalctl -fu prysmvalidator

Teku

$ cd ~
$ curl -LO https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/22.9.0/teku-22.9.0.tar.gz
$ sudo systemctl stop teku
$ tar xvf teku-22.9.0.tar.gz
$ sudo rm -r /usr/local/bin/teku # <-- Remove the old files
$ sudo cp -a teku-22.9.0 /usr/local/bin/teku
$ rm teku-22.9.0.tar.gz
$ rm -r teku-22.9.0
$ sudo nano /etc/systemd/system/teku.service
[Unit]
Description=Teku Consensus Client (Mainnet)
Wants=network-online.target
After=network-online.target
[Service]
User=teku
Group=teku
Type=simple
Restart=always
RestartSec=5
Environment="JAVA_OPTS=-Xmx3g"
Environment="TEKU_OPTS=-XX:-HeapDumpOnOutOfMemoryError"
ExecStart=/usr/local/bin/teku/bin/teku --network=mainnet --data-path=/var/lib/teku --validator-keys=/var/lib/teku/validator_keys:/var/lib/teku/validator_keys --ee-endpoint=http://127.0.0.1:8551 --ee-jwt-secret-file=/var/lib/jwtsecret/jwt.hex --validators-proposer-default-fee-recipient=FeeRecipientAddress --validators-graffiti="<yourgraffiti>"
[Install]
WantedBy=multi-user.target
ExecStart=/usr/local/bin/teku/bin/teku --network=mainnet --data-path=/var/lib/teku --validator-keys=/var/lib/teku/validator_keys:/var/lib/teku/validator_keys --ee-endpoint=http://127.0.0.1:8551 --ee-jwt-secret-file=/var/lib/jwtsecret/jwt.hex --validators-proposer-default-fee-recipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --validators-graffiti="Validatoor"
$ sudo systemctl daemon-reload
$ sudo systemctl start teku
$ sudo journalctl -fu teku

Appendix A — Uninstalling Geth

$ sudo systemctl stop geth
$ sudo systemctl disable geth
$ sudo rm /etc/systemd/system/geth.service
$ sudo rm /usr/lib/systemd/system/geth.service
$ sudo systemctl daemon-reload
$ sudo systemctl reset-failed
$ sudo apt remove -y geth
$ sudo add-apt-repository --remove ppa:ethereum/ethereum
$ sudo apt autoremove
$ sudo rm -r /var/lib/goethereum
$ sudo deluser goeth

Appendix B— Pruning Geth

  • You have followed the instructions above to update Geth to a Merge Ready state.
  • Geth must be fully synced.
  • Geth logs are not showing “state snapshot generation” messages. You can see the service log output using $ sudo journalctl -fu geth.service. If it is, it should show an “eta” with a time interval. Allow that to elapse + 128 blocks (~35 mins) before starting the prune operation.
  • Geth will not be operating normally during the prune operation. The prune operation takes around 4–6 hours.
  • There must be more than 25GB free space on your server for the prune to run without risk of failure. Check available space using the df -h command. For example, the output below shows the main partition is /dev/hda1 and there is 82GB free:
ethstaker@ETH-STAKER-001:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 796M 996K 795M 1% /run
/dev/hda1 155G 74G 82G 48% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/vda15 105M 5.2M 100M 5% /boot/efi
tmpfs 796M 0 796M 0% /run/user/1000

Start the Prune Operation

$ sudo systemctl stop geth
$ sudo nano /etc/systemd/system/geth.service
[Unit]
Description=Geth Execution Client (Mainnet)
After=network.target
Wants=network.target
[Service]
User=geth
Group=geth
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/geth --mainnet --datadir /var/lib/geth --authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex snapshot prune-state
[Install]
WantedBy=default.target
$ sudo systemctl daemon-reload
$ sudo systemctl start geth
$ sudo systemctl status geth
$ sudo systemctl stop geth
$ sudo nano /etc/systemd/system/geth.service
[Unit]
Description=Geth Execution Client (Mainnet)
After=network.target
Wants=network.target
[Service]
User=geth
Group=geth
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/geth --mainnet --datadir /var/lib/geth --authrpc.jwtsecret /var/lib/jwtsecret/jwt.hex
[Install]
WantedBy=default.target
$ sudo systemctl daemon-reload
$ sudo systemctl start geth
$ sudo systemctl status geth # <-- Check for errors
$ sudo journalctl -fu geth.service # <-- Monitor

Full Disclaimer

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Somer Esat

Somer Esat

Passionate about Ethereum and decentralized technology.