English
Guide | How to setup a validator on ETH2 testnet PRATER
Become a validator and help secure eth2, a proof-of-stake blockchain. Anyone with 32 ETH can join.

Announcements

2022-6 Gitcoin Grant Round 14: We improve this guide with your support!
​Help fund us and earn a POAP NFT. Appreciate your support!πŸ™
As of Dec 1 2021, this is guide version 3.7.0 and written for testnet PRATER.
Always test and practice on testnet first.

Changelog - Update Notes - Dec 1 2021

  • Added how to check your Validator's Sync Committee duties​
  • Formatting fixes and updated Teku initial state API.
  • Updated with consensus layer (CL), the execution layer (EL), formerly known as eth2 and eth1.
  • Added erigon build dependencies.
  • Added Teku and Lodestar Checkpoint Sync feature, the quickest way to sync a Ethereum beacon chain client.
  • geth + erigon pruning / Altair hard fork changes / nimbus eth1 fallback
  • lighthouse + prysm doppelganger protection enabled. Doppelganger protection intentionally misses an epoch on startup and listens for attestations to make sure your keys are not still running on the old validator client.
  • OpenEthereum will no longer be supported post London hard fork. Gnosis, maintainers of OpenEthereum, suggest users migrate to their new Erigon Ethererum client. Added setup instructions for Erigon under eth1 node section.
  • Updated eth2.0-deposit-cli to v.1.2.0 and added section on eth1 withdrawal address
  • Added generating mnemonic seeds on Tails OS by punggolzenith​
  • Iancoleman.io BLS12-381 Key Generation Tool how-to added​
  • Testnet guide forked for Prater testnet staking
  • ​Geth pruning guide created
  • Major changes to Lodestar guide
  • Additional Grafana Dashboards for Prysm, Lighthouse and Nimbus
  • Translations now available for Japanese, Chinese and Spanish (access by changing site language)
  • Generate keystore files on Ledger Nano X, Nano S and Trezor Model T with tool from allnodes.com​

Latest Essential Ethereum Staking Reading

​​
🏁
0. Prerequisites

​
πŸ‘©πŸ’»
Skills for operating a eth validator and beacon node

As a validator for eth, you will typically have the following abilities:
  • operational knowledge of how to set up, run and maintain a eth beacon node and validator continuously
  • a long term commitment to maintain your validator 24/7/365
  • basic operating system skills

​
πŸ‘¨πŸ’»
Experience required to be a successful validator

​
πŸŽ—
Minimum Setup Requirements

  • Operating system: 64-bit Linux (i.e. Ubuntu 20.04 LTS Server or Desktop)
  • Processor: Dual core CPU, Intel Core i5–760 or AMD FX-8100 or better
  • Memory: 8GB RAM
  • Storage: 128GB SSD
  • Internet: Broadband internet connection with speeds at least 1 Mbps.
  • Power: Reliable electrical power.
  • ETH balance: at least 32 goerli ETH and some goerli ETH for deposit transaction fees
  • Wallet: Metamask installed
  • Operating system: 64-bit Linux (i.e. Ubuntu 20.04 LTS Server or Desktop)
  • Processor: Quad core CPU, Intel Core i7–4770 or AMD FX-8310 or better
  • Memory: 16GB RAM or more
  • Storage: 2TB SSD or more
  • Internet: Broadband internet connections with speeds at least 10 Mbps without data limit.
  • Power: Reliable electrical power with uninterruptible power supply (UPS)
  • ETH balance: at least 32 goerli ETH and some goerli ETH for deposit transaction fees
  • Wallet: Metamask installed
​
πŸ’‘
For examples of actual staking hardware builds, check out RocketPool's hardware guide.
​
✨
Pro Validator Tip: Highly recommend you begin with a brand new instance of an OS, VM, and/or machine. Avoid headaches by NOT reusing testnet keys, wallets, or databases for your validator.
If you need ideas or a reminder on how to secure your validator, refer to the security best practices guide.

​
πŸ› 
Setup Ubuntu

If you need to install Ubuntu Server, refer to this guide.​
Or Ubuntu Desktop, refer to this guide.​

​
🎭
Setup Metamask

If you need to install Metamask, refer to this guide.​

​
🧩
High Level Validator Node Overview

At the end of this guide, you will build a node that hosts three main components in two layers: consensus layer consists of a consensus client, also known as a validator client with a beacon chain client. The execution layer consists of a execution client, formerly a eth1 node.
Validator client - Responsible for producing new blocks and attestations in the beacon chain and shard chains.
Beacon chain client - Responsible for managing the state of the beacon chain, validator shuffling, and more.
Execution client (aka Eth1 node) - Supplies incoming validator deposits from the eth
chain to the beacon chain client.
Note: Teku and Nimbus combines both clients into one process.
How Ethereum fits together featuring Leslie the ETH Rhino, the mascot named after American computer scientist Leslie Lamport

​
🌱
1. Obtain testnet ETH

Every 32 ETH you own allows you to make 1 validator. You can run thousands of validators with your beacon node. However on testnet, please only run 1 or 2 validators to keep the activation queue reasonably quick.
Join the ethstaker Discord and send a request for ETH in the -request-goerli-eth channel
1
!send <your metamask goerli network ETH address>
Copied!
Otherwise, visit the
🚰
​Goerli Authenticated Faucet.

​
πŸ‘©πŸ’»
2. Signup to be a validator at the Launchpad

  1. 1.
    Install dependencies, the ethereum foundation deposit tool and generate your two sets of key pairs.
Each validator will have two sets of key pairs. A signing key and a withdrawal key. These keys are derived from a single mnemonic phrase. Learn more about keys.​
You have the choice of downloading the pre-built ethereum foundation deposit tool or building it from source. Alternatively, if you have a Ledger Nano X/S or Trezor Model T, you're able to generate deposit files with keys managed by a hardware wallet.
Build from source code
Pre-built eth2deposit-cli
Hardware Wallet - Most Secure
Advanced - Most Secure
Install dependencies.
1
sudo apt update
2
sudo apt install python3-pip git -y
Copied!
​
Download source code and install.
1
cd $HOME
2
git clone https://github.com/ethereum/eth2.0-deposit-cli.git eth2deposit-cli
3
cd eth2deposit-cli
4
sudo ./deposit.sh install
Copied!
​
Make a new mnemonic.
1
./deposit.sh new-mnemonic --chain prater
Copied!
​
Advanced option: Custom eth1 withdrawal address, often used for 3rd party staking.
1
# Add the following
2
--eth1_withdrawal_address <eth1 address hex string>
3
# Example
4
./deposit.sh new-mnemonic --chain prater --eth1_withdrawal_address 0x1...x
Copied!
If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in EIP-2334 format.
Download eth2deposit-cli.
1
cd $HOME
2
wget https://github.com/ethereum/eth2.0-deposit-cli/releases/download/v1.2.0/eth2deposit-cli-256ea21-linux-amd64.tar.gz
Copied!
​
Verify the SHA256 Checksum matches the checksum on the releases page.
1
echo "825035b6d6c06c0c85a38f78e8bf3e9df93dfd16bf7b72753b6888ae8c4cb30a *eth2deposit-cli-ed5a6d3-linux-amd64.tar.gz" | shasum -a 256 --check
Copied!
​
Example valid output:
eth2deposit-cli-256ea21-linux-amd64.tar.gz: OK
Only proceed if the sha256 check passes with OK!
​
Extract the archive.
1
tar -xvf eth2deposit-cli-256ea21-linux-amd64.tar.gz
2
mv eth2deposit-cli-256ea21-linux-amd64 eth2deposit-cli
3
rm eth2deposit-cli-256ea21-linux-amd64.tar.gz
4
cd eth2deposit-cli
Copied!
​
Make a new mnemonic.
1
./deposit new-mnemonic --chain prater
Copied!
​
Advanced option: Custom eth1 withdrawal address, often used for 3rd party staking.
1
# Add the following
2
--eth1_withdrawal_address <eth1 address hex string>
3
# Example
4
./deposit.sh new-mnemonic --chain prater --eth1_withdrawal_address 0x1...x
Copied!
If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in EIP-2334 format.

How to generate validator keys with Ledger Nano X/S and Trezor Model T

​Allnodes has created an easy to use tool to connect a Ledger Nano X/S and Trezor Model T and generate the deposit json files such that the withdrawal credentials remain secured by the hardware wallet. This tool can be used by any validator or staker.
​
  1. 1.
    Connect your hardware wallet to your PC/laptop
  2. 2.
    If using a Ledger Nano X/S, open the "ETHEREUM" ledger app (if missing, install from Ledger Live)
  3. 4.
    Select network > Gorli Testnet
  4. 5.
    Select your wallet > then CONTINUE
6. From the dropdown, select your eth address with at least 32 ETH to fund your validators
7. On your hardware wallet, sign the ETH signature message to login to allnodes.com
8. Again on your hardware wallet, sign another message to verify your eth2 withdrawal credentials
Double check that your generated deposit data file contains the same string as in withdrawal credentials and that this string includes your Ethereum address (starting after 0x)
9. Enter the amount of nodes (or validators you want)
10. Finally, enter a KEYSTORE password to encrypt the deposit json files. Keep this password safe and offline.
11. Confirm password and click GENERATE
​
πŸ”₯
[ Optional ] Pro Security Tip: Run the eth2deposit-cli tool and generate your mnemonic seed for your validator keys on an air-gapped offline machine booted from usb.
You will learn how to boot up a windows PC into an airgapped Tails operating system.
The Tails OS is an amnesic operating system, meaning it will save nothing and leave no tracks behind each time you boot it.

Part 0 - Prerequisites

You need:
  • 2 storage mediums (can be USB stick, SD cards or external hard drives)
  • One of them must be > 8GB
  • Windows or Mac computer
  • 30 minutes or longer depending on your download speed

Part 1 - Download Tails OS

Download the official image from the Tails website. Might take a while, go grab a coffee.
Make sure you follow the guide on the Tails website to verify your download of Tails.

Part 2 - Download and install the software to transfer your Tails image on your USB stick

For Windows, use one of
For Mac, download Etcher​

Part 3 - Making your bootable USB stick

Run the above software. This is an example how it looks like on Mac OS with etcher, but other software should be similar.
Select the Tails OS image that you downloaded as the image. Then select the USB stick (the larger one).
Then flash the image to the larger USB stick.

Part 4 - Download and verify the eth2-deposit-cli

You can refer to the other tab on this guide on how to download and verify the eth2-deposit-cli.
Copy the file to the other USB stick.

Part 5 - Reboot your computer and into Tails OS

After you have done all the above, you can reboot. If you are connected by a LAN cable to the internet, you can disconnect it manually.
Plug in the USB stick that has your Tails OS.
On Mac, press and hold the Option key immediately upon hearing the startup chime. Release the key after Startup Manager appears.
On Windows, it depends on your computer manufacturer. Usually it is by pressing F1 or F12. If it doesn't work, try googling "Enter boot options menu on [Insert your PC brand]"
Choose the USB stick that you loaded up with Tails OS to boot into Tails.

Part 6 - Welcome to Tails OS

You can boot with all the default settings.

Part 7 - Run the eth2-deposit-cli

Plug in your other USB stick with the eth2-deposit-cli file.
You can then open your command line and navigate into the directory containing the file. Then you can continue the guide from the other tab.
Make a new mnemonic.
1
./deposit.sh new-mnemonic --chain prater
Copied!
If you ran this command directly from your non-Tails USB stick, the validator keys should stay on it. If it hasn't, copy the directory over to your non-Tails USB stick.
​
πŸ”₯
Make sure you have saved your validator keys directory in your other USB stick (non Tails OS) before you shutdown Tails. Tails will delete everything saved on it after you shutdown..
​
πŸŽ‰
Congrats on learning how to use Tails OS to make an air gapped system. As a bonus, you can reboot into Tails OS again and connect to internet to surf the dark web or clear net safely!
Alternatively, follow this ethstaker.cc exclusive for the low down on making a bootable usb.
Part 1 - Create a Ubuntu 20.04 USB Bootable Drive
Part 2 - Install Ubuntu 20.04 from the USB Drive
You can copy via USB key the pre-built eth2deposit-cli binaries from an online machine to an air-gapped offline machine booted from usb. Make sure to disconnect the ethernet cable and/or WIFI.
2. If using eth2deposit-cli, follow the prompts and pick a KEYSTORE password. This password encrypts your keystore files. Write down your mnemonic and keep this safe and offline.
Do not send real mainnet ETH during this process!
πŸ›‘
Use only goerli ETH.
Caution: Only deposit the 32 ETH per validator if you are confident your execution client (ETH1 node) and consensus client (ETH2 validator) will be fully synched and ready to perform validator duties. You can return later to launchpad with your deposit-data to finish the next steps.
3. Follow the steps at https://prater.launchpad.ethereum.org while skipping over the steps you already just completed. Study the eth2 phase 0 overview material. Understanding eth2 is the key to success!
​
🐳
Batch Depositing Tip: If you have many deposits to make for many validators, consider using Abyss.finance's eth2depositor tool. This greatly improves the deposit experience as multiple deposits can be batched into one transaction, thereby saving gas fees and saving your fingers by minimizing Metamask clicking.
Make sure to switch to GΓ–RLI network.
4. Back on the launchpad website, upload yourdeposit_data-#########.json found in the validator_keys directory.
5. Connect to the launchpad with your Metamask wallet, review and accept terms. Ensure you're connected to GΓ–RLI network.
6. Confirm the transaction(s). There's one deposit transaction of 32 ETH for each validator.
For instance, if you want to run 3 validators you will need to have (32 x 3) = 96 goerli ETH plus some extra to cover the gas fees.
Your transaction is sending and depositing your ETH to the prater ETH2 deposit contract address.
Check, double-check, triple-check that the prater Eth2 deposit contract address is correct.
​
πŸ”₯
Critical Crypto Reminder: Keep your mnemonic, keep your ETH.
  • Write down your mnemonic seed offline. Not email. Not cloud.
  • Multiple copies are better. Best stored in a metal seed.​
  • The withdrawal keys will be generated from this mnemonic in the future.
  • Make offline backups, such as to a USB key, of your validator_keys directory.

​
πŸ›Έ
3. Install execution client (ETH1 node)

Ethereum requires a connection to the execution client in order to monitor for 32 ETH validator deposits. Hosting your own execution client is the best way to maximize decentralization and minimize dependency on third parties such as Infura.
The subsequent steps assume you have completed the best practices security guide.​
​
πŸ›‘
Do not run your processes as ROOT user.
😱
​
Your choice of either Geth, Besu, Nethermind, or Erigon.
Geth
Besu
Nethermind
Erigon
OpenEthereum (Retired)
Geth - Go Ethereum is one of the three original implementations (along with C++ and Python) of the Ethereum protocol. It is written in Go, fully open source and licensed under the GNU LGPL v3.
Review the latest release notes at https://github.com/ethereum/go-ethereum/releases​
​
​
🧬
Install from the repository
1
sudo add-apt-repository -y ppa:ethereum/ethereum
2
sudo apt-get update -y
3
sudo apt dist-upgrade -y
4
sudo apt-get install ethereum -y
Copied!
​
​
βš™
Setup and configure systemd
Run the following to create a unit file to define your eth1.service configuration.
Simply copy/paste the following.
1
cat > $HOME/eth1.service << EOF
2
[Unit]
3
Description = geth execution client service
4
Wants = network-online.target
5
After = network-online.target
6
​
7
[Service]
8
User = $(whoami)
9
ExecStart = /usr/bin/geth --http --goerli --metrics --pprof
10
Restart = on-failure
11
RestartSec = 3
12
KillSignal = SIGINT
13
TimeoutStopSec = 300
14
​
15
[Install]
16
WantedBy = multi-user.target
17
EOF
Copied!
​
Nimbus Specific Configuration: Add the following flag to the ExecStart line.
1
--ws
Copied!
​
Move the unit file to /etc/systemd/system and give it permissions.
1
sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
Copied!
1
sudo chmod 644 /etc/systemd/system/eth1.service
Copied!
​
Run the following to enable auto-start at boot time.
1
sudo systemctl daemon-reload
2
sudo systemctl enable eth1
Copied!
​
​
β›“
Start geth
1
sudo systemctl start eth1
Copied!
​
Geth Tip: When is my geth node synched?
  1. 1.
    Attach to the geth console with:geth attach http://127.0.0.1:8545``
  2. 2.
    Type the following:eth.syncing
  3. 3.
    If it returns false, your geth node is synched.
Hyperledger Besu is an open-source Ethereum client designed for demanding enterprise applications requiring secure, high-performance transaction processing in a private network. It's developed under the Apache 2.0 license and written in Java.
​
​
🧬
Install java dependency
1
sudo apt update
2
sudo apt install openjdk-11-jdk -y
Copied!
​
​
🌜
Download and unzip Besu
Review the latest release at https://github.com/hyperledger/besu/releases​
Update BINARIES_URL with the latest url.
1
BINARIES_URL="https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.4.3/besu-22.4.3.tar.gz"
2
​
3
cd $HOME
4
wget -O besu.tar.gz "$BINARIES_URL"
5
tar -xzvf besu.tar.gz -C $HOME
6
rm besu.tar.gz
7
mv besu* besu
Copied!
​
​
βš™
Setup and configure systemd
Run the following to create a unit file to define your eth1.service configuration.
Simply copy/paste the following.
1
cat > $HOME/eth1.service << EOF
2
[Unit]
3
Description = Besu Execution Layer Client service
4
Wants = network-online.target
5
After = network-online.target
6
​
7
[Service]
8
User = $USER
9
Restart = on-failure
10
RestartSec = 3
11
KillSignal = SIGINT
12
TimeoutStopSec = 300
13
ExecStart = $HOME/besu/bin/besu \
14
--network=mainnet \
15
--rpc-http-host="0.0.0.0" \
16
--rpc-http-cors-origins="*" \
17
--rpc-ws-enabled=true \
18
--rpc-http-enabled=true \
19
--rpc-ws-host="0.0.0.0" \
20
--host-allowlist="*" \
21
--metrics-enabled=true \
22
--metrics-host=0.0.0.0 \
23
--data-storage-format=BONSAI \
24
--data-path="$HOME/.besu"
25
​
26
[Install]
27
WantedBy = multi-user.target
28
EOF
Copied!
​
Move the unit file to /etc/systemd/system and give it permissions.
1
sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
Copied!
1
sudo chmod 644 /etc/systemd/system/eth1.service
Copied!
​
Run the following to enable auto-start at boot time.
1
sudo systemctl daemon-reload
2
sudo systemctl enable eth1
Copied!
​
​
β›“
Start besu
1
sudo systemctl start eth1
Copied!
Nethermind is a flagship Ethereum client all about performance and flexibility. Built on .NET core, a widespread, enterprise-friendly platform, Nethermind makes integration with existing infrastructures simple, without losing sight of stability, reliability, data integrity, and security.
​
​
βš™
Install dependencies
1
sudo apt-get update
2
sudo apt-get install curl libsnappy-dev libc6-dev jq libc6 unzip -y
Copied!
​
​
🌜
Download and unzip Nethermind
Review the latest release at https://github.com/NethermindEth/nethermind/releases​
Automatically download the latest linux release, un-zip and cleanup.
1
mkdir $HOME/nethermind
2
chmod 775 $HOME/nethermind
3
cd $HOME/nethermind
4
curl -s https://api.github.com/repos/NethermindEth/nethermind/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux-amd64 | xargs wget -q --show-progress
5
unzip -o nethermind*.zip
6
rm nethermind*linux*.zip
Copied!
​
​
βš™
Setup and configure systemd
Run the following to create a unit file to define your eth1.service configuration.
Simply copy/paste the following.
1
cat > $HOME/eth1.service << EOF
2
[Unit]
3
Description = nethermind eth1 service
4
Wants = network-online.target
5
After = network-online.target
6
​
7
[Service]
8
User = $(whoami)
9
ExecStart = $(echo $HOME)/nethermind/Nethermind.Runner --config goerli --baseDbPath $HOME/.nethermind_goerli --Metrics.Enabled true --JsonRpc.Enabled true --Sync.DownloadBodiesInFastSync true --Sync.DownloadReceiptsInFastSync true --Sync.AncientBodiesBarrier 11052984 --Sync.AncientReceiptsBarrier 11052984
10
Restart = on-failure
11
RestartSec = 3
12
KillSignal = SIGINT
13
TimeoutStopSec = 300
14
​
15
[Install]
16
WantedBy = multi-user.target
17
EOF
Copied!
Move the unit file to /etc/systemd/system and give it permissions.
1
sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
Copied!
1
sudo chmod 644 /etc/systemd/system/eth1.service
Copied!
​
Run the following to enable auto-start at boot time.
1
sudo systemctl daemon-reload
2
sudo systemctl enable eth1
Copied!
​
​
β›“
Start Nethermind
1
sudo systemctl start eth1
Copied!
​
Note about Metric Error messages: You will see these until prometheus pushergateway is setup in section 6. Error in MetricPusher: System.Net.Http.HttpRequestException: Connection refused
Erigon - Successor to OpenEthereum, Erigon is an implementation of Ethereum (aka "Ethereum client"), on the efficiency frontier, written in Go.
​
​
βš™
Install Go dependencies
1
wget -O go.tar.gz https://golang.org/dl/go1.16.5.linux-amd64.tar.gz
Copied!
1
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz
Copied!
1
echo export PATH=$PATH:/usr/local/go/bin>> $HOME/.bashrc
2
source $HOME/.bashrc
Copied!
​
Verify Go is properly installed and cleanup files.
1
go version
2
rm go.tar.gz
Copied!
​
​
πŸ€–
Build and install Erigon
Install build dependencies.
1
sudo apt-get update
2
sudo apt install build-essential git
Copied!
​
Review the latest release at https://github.com/ledgerwatch/erigon/releases​
1
cd $HOME
2
git clone --recurse-submodules -j8 https://github.com/ledgerwatch/erigon.git
3
cd erigon
4
make erigon && make rpcdaemon
Copied!
​
​ Make data directory and update directory ownership.
1
sudo mkdir -p /var/lib/erigon
2
sudo chown $USER:$USER /var/lib/erigon
Copied!
​
​
βš™
Setup and configure systemd
Run the following to create a unit file to define your eth1.service configuration.
Simply copy/paste the following.
1
cat > $HOME/eth1.service << EOF
2
[Unit]
3
Description = erigon eth1 service
4
Wants = network-online.target
5
After = network-online.target
6
Requires = eth1-erigon.service
7
​
8
[Service]
9
Type = simple
10
User = $USER
11
ExecStart = $HOME/erigon/build/bin/erigon --datadir /var/lib/erigon --chain goerli --private.api.addr=localhost:9089 --metrics --pprof --prune htc
12
Restart = on-failure
13
RestartSec = 3
14
KillSignal = SIGINT
15
TimeoutStopSec = 300
16
​
17
[Install]
18
WantedBy = multi-user.target
19
EOF
Copied!
​
By default with Erigon, --prune deletes data older than 90K blocks from the tip of the chain (aka, for if tip block is no. 12'000'000, only the data between 11'910'000-12'000'000 will be kept).
​
1
cat > $HOME/eth1-erigon.service << EOF
2
[Unit]
3
Description = erigon rpcdaemon service
4
BindsTo = eth1.service
5
After = eth1.service
6
​
7
[Service]
8
Type = simple
9
User = $USER
10
ExecStartPre = /bin/sleep 3
11
ExecStart = $HOME/erigon/build/bin/rpcdaemon --private.api.addr=localhost:9089 --datadir /var/lib/erigon --http.api=eth,erigon,web3,net,debug,trace,txpool,shh --txpool.api.addr=localhost:9089
12
Restart = on-failure
13
RestartSec = 3
14
KillSignal = SIGINT
15
TimeoutStopSec = 300
16
​
17
[Install]
18
WantedBy = eth1.service
19
EOF
Copied!
​
Move the unit files to /etc/systemd/system and give it permissions.
1
sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
2
sudo mv $HOME/eth1-erigon.service /etc/systemd/system/eth1-erigon.service
Copied!
1
sudo chmod 644 /etc/systemd/system/eth1.service
2
sudo chmod 644 /etc/systemd/system/eth1-erigon.service
Copied!
​
Run the following to enable auto-start at boot time.
1
sudo systemctl daemon-reload
2
sudo systemctl enable eth1 eth1-erigon
Copied!
​
​
β›“
Start Erigon
1
sudo systemctl start eth1
Copied!
OpenEthereum will no longer be supported post London hard fork. Gnosis, maintainers of OpenEthereum, suggest users migrate to their new Erigon Ethererum client.
OpenEthereum - It's goal is to be the fastest, lightest, and most secure Ethereum client using the Rust programming language. OpenEthereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
​
​
βš™
Install dependencies
1
sudo apt-get update
2
sudo apt-get install curl jq unzip -y
Copied!
​
​
πŸ€–
Install OpenEthereum
Automatically download the latest linux release, un-zip, add execute permissions and cleanup.
1
mkdir $HOME/openethereum
2
cd $HOME/openethereum
3
curl -s https://api.github.com/repos/openethereum/openethereum/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep linux | xargs wget -q --show-progress
4
unzip -o openethereum*.zip
5
chmod +x openethereum
6
rm openethereum*.zip
Copied!
​
​
βš™
Setup and configure systemd
Run the following to create a unit file to define your eth1.service configuration.
Simply copy/paste the following.
1
cat > $HOME/eth1.service << EOF
2
[Unit]
3
Description = openethereum eth1 service
4
Wants = network-online.target
5
After = network-online.target
6
​
7
[Service]
8
User = $(whoami)
9
ExecStart = $(echo $HOME)/openethereum/openethereum --chain goerli --metrics --metrics-port=6060
10
Restart = on-failure
11
RestartSec = 3
12
KillSignal = SIGINT
13
TimeoutStopSec = 300
14
​
15
[Install]
16
WantedBy = multi-user.target
17
EOF
Copied!
Nimbus Specific Configuration: Add the following flag to the **ExecStart **line.
1
--ws-origins=all
Copied!
Move the unit file to /etc/systemd/system and give it permissions.
1
sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
Copied!
1
sudo chmod 644 /etc/systemd/system/eth1.service
Copied!
Run the following to enable auto-start at boot time.
1
sudo systemctl daemon-reload
2
sudo systemctl enable eth1
Copied!
​
​
β›“
Start OpenEthereum
1
sudo systemctl start eth1
Copied!
Syncing an execution client can take up to 1 week. On high-end machines with gigabit internet, expect syncing to take less than a day.
Your execution client is fully sync'd when these events occur.
  • OpenEthereum: Imported #<block number>
  • Geth: Imported new chain segment
  • Besu: Imported #<block number>
  • Nethermind: No longer syncing Old Headers

​
πŸ› 
Helpful eth1.service commands

​​
πŸ—’
To view and follow eth1 logs
1
journalctl -fu eth1
Copied!
​
πŸ—’
To stop eth1 service
1
sudo systemctl stop eth1
Copied!

4. Configure consensus client (beacon chain and validator)

Your choice of Lighthouse, Nimbus, Teku, Prysm or Lodestar.
Lighthouse
Nimbus
Teku
Prysm
Lodestar
​Lighthouse is an Eth client with a heavy focus on speed and security. The team behind it, Sigma Prime, is an information security and software engineering firm who have funded Lighthouse along with the Ethereum Foundation, Consensys, and private individuals. Lighthouse is built in Rust and offered under an Apache 2.0 License.
​

​
βš™
4.1. Install rust dependency

1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Copied!
​
Enter '1' to proceed with the default install.
Update your environment variables.
1
echo export PATH="$HOME/.cargo/bin:$PATH" >> ~/.bashrc
2
source ~/.bashrc
Copied!
​
Install rust dependencies.
1
sudo apt-get update
2
sudo apt install -y git gcc g++ make cmake pkg-config libssl-dev libclang-dev clang
Copied!
​

​
πŸ’‘
4.2. Build Lighthouse from source

1
mkdir ~/git
2
cd ~/git
3
git clone https://github.com/sigp/lighthouse.git
4
cd lighthouse
5
git fetch --all && git checkout stable && git pull
6
make
Copied!
​
In case of compilation errors, run the following sequence.
1
rustup update
2
cargo clean
3
make
Copied!
​
This build process may take a few minutes.
​
Verify lighthouse was installed properly by checking the version number.
1
lighthouse --version
Copied!
​

​
🎩
4.3. Import validator key

When you import your keys into Lighthouse, your validator signing key(s) are stored in the $HOME/.lighthouse/prater/validators folder.
​
Run the following command to import your validator keys from the eth2deposit-cli tool directory.
Enter your keystore password to import accounts.
1
lighthouse account validator import --network prater --directory=$HOME/eth2deposit-cli/validator_keys
Copied!
​
Verify the accounts were imported successfully.
1
lighthouse account_manager validator list --network prater
Copied!
​
WARNING: DO NOT USE THE ORIGINAL KEYSTORES TO VALIDATE WITH ANOTHER CLIENT, OR YOU WILL GET SLASHED.
​

​
πŸ”₯
4.4. Configure port forwarding and/or firewall

Specific to your networking setup or cloud provider settings, ensure your validator's firewall ports are open and reachable.​
  • Lighthouse consensus client requires port 9000 for tcp and udp
  • Execution client requires port 30303 for tcp and udp
​
​
✨
Port Forwarding Tip: You'll need to forward and open ports to your validator. Verify it's working with https://www.yougetsignal.com/tools/open-ports/ or https://canyouseeme.org/ .
​

​
β›“
4.5. Start the beacon chain

​
​
🍰
Benefits of using systemd for your beacon chain
  1. 1.
    Auto-start your beacon chain when the computer reboots due to maintenance, power outage, etc.
  2. 2.
    Automatically restart crashed beacon chain processes.
  3. 3.
    Maximize your beacon chain up-time and performance.
​
​
πŸ› 
Setup Instructions for Systemd
Run the following to create a unit file to define yourbeacon-chain.service configuration. Simply copy and paste.
1
cat > $HOME/beacon-chain.service << EOF
2
# The eth beacon chain service (part of systemd)
3
# file: /etc/systemd/system/beacon-chain.service
4
​
5
[Unit]
6
Description = eth beacon chain service
7
Wants = network-online.target
8
After = network-online.target
9
​
10
[Service]
11
User = $USER
12
ExecStart = $(which lighthouse) bn --staking --validator-monitor-auto --metrics --network prater
13
Restart = on-failure
14
​
15
[Install]
16
WantedBy = multi-user.target
17
EOF
Copied!
​
​
πŸ”₯
Lighthouse Pro Tip: On the ExecStart line, adding the --eth1-endpoints flag allows for redundant execution clients. Separate with comma. Make sure the endpoint does not end with a trailing slash or/ Remove it.
1
# Example:
2
--eth1-endpoints http://localhost:8545,https://nodes.mewapi.io/rpc/eth,https://prater.eth.cloud.ava.do,https://prater.infura.io/v3/xxx
Copied!
​
πŸ’Έ
Find free ethereum fallback nodes at https://ethereumnodes.com/​
​
Move the unit file to /etc/systemd/system
1
sudo mv $HOME/beacon-chain.service /etc/systemd/system/beacon-chain.service
Copied!
​
Update file permissions.
1
sudo chmod 644 /etc/systemd/system/beacon-chain.service
Copied!
​
Run the following to enable auto-start at boot time and then start your beacon node service.
1
sudo systemctl daemon-reload
2
sudo systemctl enable beacon-chain
3
sudo systemctl start beacon-chain
Copied!
​
Troubleshooting common issues:
The beacon chain couldn't connect to the :8545 service?
  • In the beacon chain unit file under [Service], add, "ExecStartPre = /bin/sleep 30" so that it waits 30 seconds for execution client to startup before connecting.
CRIT Invalid eth1 chain id. Please switch to correct chain id.
  • Allow your execution client to fully sync.
​
Nice work. Your beacon chain is now managed by the reliability and robustness of systemd. Below are some commands for using systemd.
​
​
πŸ› 
Some helpful systemd commands
​
πŸ—„ Viewing and filtering logs
1
#view and follow the log
2
journalctl --unit=beacon-chain -f
Copied!
1
#view log since yesterday
2
journalctl --unit=beacon-chain --since=yesterday
Copied!
1
#view log since today
2
journalctl --unit=beacon-chain --since=today
Copied!
1
#view log between a date
2
journalctl --unit=beacon-chain --since='2020-12-01 00:00:00' --until='2020-12-02 12:00:00'