CoinCashew
English
English
  • Home
  • About Us
  • Donations
  • Contributing
    • Contributor Covenant Code of Conduct
    • Style Guide
  • Disclaimer
  • Wallets
    • Guide: Crypto Wallet Tips 101 - Do's and Don'ts
      • Review: Metal Bitcoin Seed Storage by jlopp
  • Coins
    • Ethereum: ETH
      • 🛡️EthPillar: one-liner setup tool and node management TUI
      • 🥩Guide | How to setup a validator for Ethereum staking on mainnet
        • Overview - Manual Installation
        • PART I - INSTALLATION
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Installing execution client
            • Nethermind
            • Besu
            • Geth
            • Erigon
            • Reth
          • Step 4: Installing consensus client
            • Lighthouse
            • Lodestar
            • Teku
            • Nimbus
            • Prysm
          • Step 5: Installing Validator
            • Setting up Validator Keys
            • Installing Validator
              • Lighthouse
              • Lodestar
              • Teku
              • Nimbus
              • Prysm
            • Next Steps
          • Monitoring your validator with Grafana and Prometheus
          • Mobile App Node Monitoring by beaconcha.in
          • Monitoring with Uptime Check by Google Cloud
        • PART II - MAINTENANCE
          • Updating Execution Client
          • Updating Consensus Client
          • Backups Checklist: Critical Staking Node Data
          • Uninstalling Staking Node
          • Finding the longest attestation slot gap
          • Checking my eth validator's sync committee duties
          • Checklist | Confirming a healthy functional ETH staking node
        • PART III - TIPS
          • Voluntary Exiting a Validator
          • Verifying Your Mnemonic Phrase
          • Adding a New Validator to an Existing Setup with Existing Seed Words
          • Switching / Migrating Consensus Client
          • 🛡️Switching / Migrating Execution Client
          • ⚡Using Node as RPC URL endpoint
          • Using All Available LVM Disk Space
          • Reducing Network Bandwidth Usage
          • How to re-sync using checkpoint sync
          • Important Directory Locations
          • Improving Validator Attestation Effectiveness
          • EIP2333 Key Generator by iancoleman.io
          • 😁Geth - Enabling path-based state storage
          • Disk Usage by Execution / Consensus Client
          • Dealing with Storage Issues on the Execution Client
        • Join the Community
        • Credits
        • See Also
        • Changelog
      • 🌠Guide | How to setup a validator for Ethereum staking on testnet HOODI
        • Overview - Manual Installation
        • Step 1: Prerequisites
        • Step 2: Configuring Node
        • Step 3: Installing execution client
          • Nethermind
          • Besu
          • Geth
          • Erigon
          • Reth
        • Step 4: Installing consensus client
          • Lighthouse
          • Lodestar
          • Teku
          • Nimbus
          • Prysm
        • Step 5: Installing Validator
          • Setting up Validator Keys
          • Installing Validator
            • Lighthouse
            • Lodestar
            • Teku
            • Nimbus
            • Prysm
          • Next Steps
        • Maintenance
          • Updating Execution Client
          • Updating Consensus Client
          • Backups Checklist: Critical Staking Node Data
          • Uninstalling Staking Node
      • ⛓️Guide | How to setup a validator for Ethereum staking on testnet HOLESKY
        • Overview - Manual Installation
        • Step 1: Prerequisites
        • Step 2: Configuring Node
        • Step 3: Installing execution client
          • Nethermind
          • Besu
          • Geth
          • Erigon
          • Reth
        • Step 4: Installing consensus client
          • Lighthouse
          • Lodestar
          • Teku
          • Nimbus
          • Prysm
        • Step 5: Installing Validator
          • Setting up Validator Keys
          • Installing Validator
            • Lighthouse
            • Lodestar
            • Teku
            • Nimbus
            • Prysm
          • Next Steps
        • Maintenance
          • Updating Execution Client
          • Updating Consensus Client
          • Backups Checklist: Critical Staking Node Data
          • Uninstalling Staking Node
      • 💰Guide | MEV-boost for Ethereum Staking
        • MEV Relay List
      • 🔎Guide | Recover Ethereum Validator Mnemonic Seed
      • 🦉Update Withdrawal Keys for Ethereum Validator (BLS to Execution Change or 0x00 to 0x01) with ETHDO
      • 📜Archived Guides
        • Guide Version 1 | How to setup a validator for Ethereum staking on MAINNET
          • PART I - INSTALLATION
            • Step 1: Prerequisites
            • Step 2: Configuring Node
            • Step 3: Setting up Validator Keys
            • Step 4: Installing execution client
            • Step 5: Installing consensus client
            • Monitoring your validator with Grafana and Prometheus
            • Mobile App Node Monitoring by beaconcha.in
            • Security Best Practices for your ETH staking validator node
            • Synchronizing time with Chrony
            • Monitoring with Uptime Check by Google Cloud
          • PART II - MAINTENANCE
            • Updating your consensus client
            • Updating your execution client
            • Uninstalling V1 Staking Node
            • Finding the longest attestation slot gap
            • Checking my eth validator's sync committee duties
            • Pruning the execution client to free up disk space
            • Checklist | Confirming a healthy functional ETH staking node
          • PART III - TIPS
            • 🛡️Switching / Migrating Execution Client
            • Voluntary Exiting a Validator
            • Verifying Your Mnemonic Phrase
            • Adding a New Validator to an Existing Setup with Existing Seed Words
            • Switching / Migrating Consensus Client
            • Using All Available LVM Disk Space
            • Reducing Network Bandwidth Usage
            • How to re-sync using checkpoint sync
            • Important Directory Locations
            • Hosting Execution client on a Different Machine
            • Adding or Changing Graffiti flag
            • Improving Validator Attestation Effectiveness
            • EIP2333 Key Generator by iancoleman.io
            • Disk Usage by Execution / Consensus Client
            • Dealing with Storage Issues on the Execution Client
          • Join the Community
          • Credits
          • See Also
          • Changelog
        • Guide Version 1 | How to setup a validator for Ethereum staking on testnet GOERLI
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Setting up Validator Keys
          • Step 4: Installing execution client
          • Step 5: Installing consensus client
        • Guide Version 2 | How to setup a validator for Ethereum staking on testnet GOERLI
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Installing execution client
            • Nethermind
            • Besu
            • Geth
            • Erigon
          • Step 4: Installing consensus client
            • Lighthouse
            • Lodestar
            • Teku
            • Nimbus
            • Prysm
          • Step 5: Installing Validator
            • Setting up Validator Keys
            • Installing Validator
              • Lighthouse
              • Lodestar
              • Teku
              • Nimbus
              • Prysm
            • Next Steps
          • Maintenance
            • Updating Execution Client
            • Updating Consensus Client
            • Backups Checklist: Critical Staking Node Data
            • Uninstalling Staking Node
        • Guide | Ethereum Staking on Zhejiang Testnet
        • Guide | Besu + Lodestar | Most Viable Diverse Client | Staking Ethereum on Kiln testnet
        • Guide | How to setup a validator for Ethereum staking on Pithos testnet in 10 minutes or less
        • Ethereum Merge Upgrade Checklist for Home Stakers and Validators
        • Guide | Operation Client Diversity: Migrate Prysm to Teku
      • Guide: How to buy ETH
    • Cardano: ADA
      • Guide: How to Set Up a Cardano Stake Pool
        • Benefits of Operating a Cardano Stake Pool
        • PART I - INSTALLATION
          • Prerequisites
          • Hardening an Ubuntu Server
          • Setting Up chrony
          • Installing the Glasgow Haskell Compiler and Cabal
          • Compiling Cardano Node
        • PART II - CONFIGURATION
          • Downloading Configuration Files
          • Configuring Topology
          • Configuring an Air-gapped, Offline Computer
          • Creating Startup Scripts and Services
        • PART III - OPERATION
          • Starting the Nodes
          • Accessing Built-in Help
          • Generating Keys for the Block-producing Node
          • Setting Up Payment and Stake Keys
          • Registering Your Stake Address
          • Registering Your Stake Pool
          • Verifying Stake Pool Operation
          • Setting Up Dashboards
          • Configuring Slot Leader Calculations
          • Securing Your Stake Pool Using a Hardware Wallet
          • Setting up a Mithril Signer
        • PART IV - ADMINISTRATION & MAINTENANCE
          • Checking Stake Pool Rewards
          • Claiming Stake Pool Rewards
          • Delegating to a Stake Pool
          • Delegating to a Representative
          • Issuing a New Operational Certificate
          • Updating Stake Pool Information
          • Upgrading a Node
          • Retiring Your Stake Pool
          • Auditing Your nodes configuration
          • KES Key Rotation / Operational Certificate Companion Script
        • PART V - TIPS
          • Submitting a Simple Transaction
          • Transferring Files Using SSH
          • Updating Configuration Files
          • Implementing Peer Sharing
          • Uploading Pool Metadata to GitHub Pages
          • Obtaining a PoolTool API Key
          • Configuring Glasgow Haskell Compiler Runtime System Options
          • Reducing Missed Slot Leader Checks and Improving Cardano Node Performance
          • Increasing Swap File Size
          • Setting Up an External Passive Relay Node
          • Setting Up WireGuard
          • Monitoring Node Security Using OSSEC Server and Slack
          • Resetting an Installation
          • Fixing a Corrupt Blockchain
          • Verifying an ITN Stake Pool
          • Fixing the Mnemonic Staking Balance Bug
        • Appendix A - Best Practices Checklist
        • Appendix B - Cardano Resource Index
        • Discord Chat Channel
        • See Also
        • Credits
      • Guide: How to buy ADA
      • Guide: How to stake ADA
    • Monero: XMR
      • Guide | How to run your own Monero node
      • Guide: How to mine Monero
      • Create a XMR paper wallet
      • External Reading Material
        • Movie: Monero Means Money
        • Guide: Zero to Monero
        • Book: Mastering Monero
Powered by GitBook
On this page
  • Pick a consensus client
  • Helpful Consensus Client systemd commands
  • Next Steps
  • Recommended Steps
  • Optional Steps
  • Need extra live support?
  • Like these guides?
  • Last Words
Edit on GitHub
  1. Coins
  2. Ethereum: ETH
  3. Archived Guides
  4. Guide Version 1 | How to setup a validator for Ethereum staking on MAINNET
  5. PART I - INSTALLATION

Step 5: Installing consensus client

PreviousStep 4: Installing execution clientNextMonitoring your validator with Grafana and Prometheus

Last updated 1 year ago

Pick a consensus client

To strengthen Ethereum's resilience against potential attacks or consensus bugs, it's best practice to run a minority client in order to increase client diversity. Find the latest distribution of consensus clients here:

Recommendation : Lodestar

Reminder: Ensure you are logged in and execute all steps in this guide as non-root user, ethereum ,created during Step 2: Configuring Node.

Your choice of , , , or .

is an Eth client with a heavy focus on speed and security. The team behind it, , 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

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Enter '1' to proceed with the default install.

Update your environment variables.

echo export PATH="$HOME/.cargo/bin:$PATH" >> ~/.bashrc
source ~/.bashrc

Install rust dependencies.

sudo apt-get update
sudo apt install -y git gcc g++ make cmake pkg-config libssl-dev libclang-dev clang protobuf-compiler

4.2. Build Lighthouse from source

mkdir ~/git
cd ~/git
git clone -b stable https://github.com/sigp/lighthouse.git
cd lighthouse
make

Improve some Lighthouse benchmarks by around 20% at the expense of increased compile time? Use maxperf profile. To compile with maxperf, replace the above make command with

PROFILE=maxperf make

In case of compilation errors, run the following sequence.

rustup update
cargo clean
make

This build process may take a few minutes.

Verify lighthouse was installed properly by checking the version number.

lighthouse --version

When you import your keys into Lighthouse, your validator signing key(s) are stored in the $HOME/.lighthouse/mainnet/validators folder.

Run the following command to import your validator keys from the eth2deposit-cli tool directory.

Enter your keystore password to import accounts.

lighthouse account validator import --network mainnet --reuse-password --directory=$HOME/staking-deposit-cli/validator_keys

Verify the accounts were imported successfully.

lighthouse account_manager validator list --network mainnet

WARNING: Do not import your validator keys into multiple validator clients and run them at the same time, or you might get slashed. If moving validators to a new setup or different validator client, ensure deletion of the previous validator keys before continuing.

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

Create a systemd unit file to define yourbeacon-chain.service configuration.

sudo nano /etc/systemd/system/beacon-chain.service

Paste the following configuration into the file.

# The eth beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain.service

[Unit]
Description=eth beacon chain service
Wants=network-online.target
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
ExecStart=/home/ethereum/.cargo/bin/lighthouse bn \
  --network mainnet \
  --staking \
  --validator-monitor-auto \
  --metrics \
  --checkpoint-sync-url=https://beaconstate.info \
  --execution-endpoint http://127.0.0.1:8551 \
  --execution-jwt /secrets/jwtsecret

[Install]
WantedBy=multi-user.target

Checkpoint Sync: allows consensus layer to start within minutes instead of days.

  • Do not trust any single checkpoint provider. Verify the state root and block root against multiple checkpoints to ensure you're on the correct chain.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/beacon-chain.service

Run the following to enable auto-start at boot time and then start your beacon node service.

sudo systemctl daemon-reload
sudo systemctl enable beacon-chain
sudo systemctl start beacon-chain

Nice work. Your beacon chain is now managed by the reliability and robustness of systemd.

Create a systemd unit file to define your validator.service configuration.

sudo nano /etc/systemd/system/validator.service

Paste the following configuration into the file.

# The eth validator service (part of systemd)
# file: /etc/systemd/system/validator.service

[Unit]
Description=eth validator service
Wants=network-online.target beacon-chain.service
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
ExecStart=/home/ethereum/.cargo/bin/lighthouse vc \
 --network mainnet \
 --metrics \
 --suggested-fee-recipient 0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS

[Install]
WantedBy=multi-user.target
  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/validator.service

Run the following to enable auto-start at boot time and then start your validator.

sudo systemctl daemon-reload
sudo systemctl enable validator
sudo systemctl start validator

Nice work. Your validator is now managed by the reliability and robustness of systemd.

Note: Nimbus combines both validator client and beacon chain client into one process.

Install dependencies.

sudo apt-get update
sudo apt-get install curl build-essential git -y

Install and build Nimbus.

mkdir ~/git
cd ~/git
git clone -b stable https://github.com/status-im/nimbus-eth2
cd nimbus-eth2
make update
make -j$(nproc) nimbus_beacon_node

The build process may take a few minutes.

Verify Nimbus was installed properly by displaying the version.

cd $HOME/git/nimbus-eth2/build
./nimbus_beacon_node --version

Copy the binary file to /usr/bin

sudo cp $HOME/git/nimbus-eth2/build/nimbus_beacon_node /usr/bin

Create a directory structure to store nimbus data.

sudo mkdir -p /var/lib/nimbus

Take ownership of this directory and set the correct permission level.

sudo chown ethereum:ethereum /var/lib/nimbus
sudo chmod 700 /var/lib/nimbus

The following command will import your validator keys.

Enter your keystore password to import accounts.

cd $HOME/git/nimbus-eth2
build/nimbus_beacon_node deposits import --data-dir=/var/lib/nimbus $HOME/staking-deposit-cli/validator_keys

Now you can verify the accounts were imported successfully by doing a directory listing.

ll /var/lib/nimbus/validators

You should see a folder named for each of your validator's pubkey.

WARNING: Do not import your validator keys into multiple validator clients and run them at the same time, or you might get slashed. If moving validators to a new setup or different validator client, ensure deletion of the previous validator keys before continuing.

Specific to your networking setup or cloud provider settings, ensure your validator's firewall ports are open and reachable.

  • Nimbus consensus client will use port 9000 for tcp and udp

  • Execution client requires port 30303 for tcp and udp

Reminder: Nimbus combines both the beacon chain and validator into one process.

Running Checkpoint Sync

Checkpoint Sync: allows consensus layer to start within minutes instead of days.

  • Do not trust any single checkpoint provider. Verify the state root and block root against multiple checkpoints to ensure you're on the correct chain.

Run the following command.

/usr/bin/nimbus_beacon_node trustedNodeSync \
--network=mainnet  \
--trusted-node-url=https://beaconstate.info \
--data-dir=/var/lib/nimbus \
--network=mainnet \
--backfill=false

When the checkpoint sync is complete, you'll see the following message:

Done, your beacon node is ready to serve you! Don't forget to check that you're on the canonical chain by comparing the checkpoint root with other online sources. See https://nimbus.guide/trusted-node-sync.html for more information.

🛠 Setup systemd service

Create a systemd unit file to define yourbeacon-chain.service configuration.

sudo nano /etc/systemd/system/beacon-chain.service

Paste the following configuration into the file.

# The eth beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain.service

[Unit]
Description=eth consensus layer beacon chain service
Wants=network-online.target
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
ExecStart=/bin/bash -c '/usr/bin/nimbus_beacon_node \
  --network=mainnet \
  --data-dir=/var/lib/nimbus \
  --web3-url=ws://127.0.0.1:8551 \
  --metrics \
  --metrics-port=8008 \
  --suggested-fee-recipient=0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS \
  --jwt-secret="/secrets/jwtsecret"'

[Install]
WantedBy=multi-user.target
  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/beacon-chain.service

Run the following to enable auto-start at boot time and then start your beacon node service.

sudo systemctl daemon-reload
sudo systemctl enable beacon-chain
sudo systemctl start beacon-chain

Nice work. Your beacon chain is now managed by the reliability and robustness of systemd.

Note: Teku combines both validator client and beacon chain client into one process.

Install git.

sudo apt-get install git -y

Install Java 17 LTS.

sudo apt update
sudo apt install openjdk-17-jdk -y

Verify Java 17+ is installed.

java --version

Install and build Teku.

mkdir ~/git
cd ~/git
git clone https://github.com/ConsenSys/teku.git
cd teku
RELEASETAG=$(curl -s https://api.github.com/repos/ConsenSys/teku/releases/latest | jq -r .tag_name)
git checkout tags/$RELEASETAG
./gradlew distTar installDist

This build process may take a few minutes.

Verify Teku was installed properly by displaying the version.

cd $HOME/git/teku/build/install/teku/bin
./teku --version

Copy the teku binary file to /usr/bin/teku

sudo cp -r $HOME/git/teku/build/install/teku /usr/bin/teku

Specific to your networking setup or cloud provider settings, ensure your validator's firewall ports are open and reachable.

  • Teku consensus client will use port 9000 for tcp and udp

  • Execution client requires port 30303 for tcp and udp

Teku combines both the beacon chain and validator into one process.

Setup a directory structure for Teku.

sudo mkdir -p /var/lib/teku
sudo mkdir -p /etc/teku
sudo chown ethereum:ethereum /var/lib/teku
sudo chown ethereum:ethereum /etc/teku

Copy your validator_files directory to the data directory we created above.

cp -r $HOME/staking-deposit-cli/validator_keys /var/lib/teku

Remove the extra deposit_data file. Answer 'y' to remove write-protected regular file.

rm /var/lib/teku/validator_keys/deposit_data*

WARNING: Do not import your validator keys into multiple validator clients and run them at the same time, or you might get slashed. If moving validators to a new setup or different validator client, ensure deletion of the previous validator keys before continuing.

Storing your keystore password in a text file is required so that Teku can decrypt and load your validators automatically.

Replace <my_keystore_password_goes_here> with your keystore password between the single quotation marks and then run the command to save it to validators-password.txt

echo '<my_keystore_password_goes_here>' > $HOME/validators-password.txt

Confirm that your keystore password is correct.

cat $HOME/validators-password.txt

Move the password file and make it read-only.

sudo mv $HOME/validators-password.txt /etc/teku/validators-password.txt
sudo chmod 600 /etc/teku/validators-password.txt

Clear the bash history in order to remove traces of keystore password.

shred -u ~/.bash_history && touch ~/.bash_history

Create your teku.yaml configuration file.

sudo nano /etc/teku/teku.yaml

Paste the following configuration into the file.

# network
network: "mainnet"
initial-state: "https://beaconstate.info/eth/v2/debug/beacon/states/finalized"

# validators
validator-keys: "/var/lib/teku/validator_keys:/var/lib/teku/validator_keys"

# execution engine
ee-endpoint: http://localhost:8551
ee-jwt-secret-file: "/secrets/jwtsecret"

# fee recipient
validators-proposer-default-fee-recipient: "<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS>"

# metrics
metrics-enabled: true
metrics-port: 8008

# database
data-path: "/var/lib/teku"
data-storage-mode: "prune"

Checkpoint Sync: allows consensus layer to start within minutes instead of days.

  • Do not trust any single checkpoint provider. Verify the state root and block root against multiple checkpoints to ensure you're on the correct chain.

  • Replace<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS> with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

When specifying directories for your validator-keys, Teku expects to find identically named keystore and password files.

For example keystore-m_12221_3600_1_0_0-11222333.json and keystore-m_12221_3600_1_0_0-11222333.txt

Create a corresponding password file for every one of your validators.

for f in /var/lib/teku/validator_keys/keystore*.json; do cp /etc/teku/validators-password.txt /var/lib/teku/validator_keys/$(basename $f .json).txt; done

Verify that your validator's keystore and validator's passwords are present by checking the following directory.

ll /var/lib/teku/validator_keys

Update directory ownership.

sudo chown -R ethereum:ethereum /var/lib/teku
sudo chown -R ethereum:ethereum /etc/teku

Use systemd to manage starting and stopping teku.



Run the following to create a unit file to define yourbeacon-chain.service configuration. Simply copy and paste.

cat > $HOME/beacon-chain.service << EOF
# The eth beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain.service

[Unit]
Description=eth consensus layer beacon chain service
Wants=network-online.target
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
User=ethereum
ExecStart=/usr/bin/teku/bin/teku -c /etc/teku/teku.yaml
Restart=on-failure
Environment=JAVA_OPTS=-Xmx5g

[Install]
WantedBy=multi-user.target
EOF

Move the unit file to /etc/systemd/system

sudo mv $HOME/beacon-chain.service /etc/systemd/system/beacon-chain.service

Update file permissions.

sudo chmod 644 /etc/systemd/system/beacon-chain.service

Run the following to enable auto-start at boot time and then start your beacon node service.

sudo systemctl daemon-reload
sudo systemctl enable beacon-chain
sudo systemctl start beacon-chain

Nice work. Your beacon chain is now managed by the reliability and robustness of systemd.

mkdir ~/prysm && cd ~/prysm
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh

Specific to your networking setup or cloud provider settings, ensure your validator's firewall ports are open and reachable.

  • Prysm consensus client will use port 12000 for udp and port 13000 for tcp

  • Execution client requires port 30303 for tcp and udp


$HOME/prysm/prysm.sh validator accounts import --mainnet --keys-dir=$HOME/staking-deposit-cli/validator_keys
  • Type "accept" to accept terms of use

  • Press enter to accept default wallet location

  • Enter a new prysm-only password to encrypt your local prysm wallet files

  • and enter the keystore password for your imported accounts.

For simplicity, use the same password for the keystore and prysm-only password.

Verify your validators imported successfully.

$HOME/prysm/prysm.sh validator accounts list --mainnet

Confirm your validator's pubkeys are listed.

#Example output:

Showing 1 validator account View the eth1 deposit transaction data for your accounts by running `validator accounts list --show-deposit-data

Account 0 | pens-brother-heat [validating public key] 0x2374.....7121

WARNING: Do not import your validator keys into multiple validator clients and run them at the same time, or you might get slashed. If moving validators to a new setup or different validator client, ensure deletion of the previous validator keys before continuing.

Create a systemd unit file to define yourbeacon-chain.service configuration.

sudo nano /etc/systemd/system/beacon-chain.service

Paste the following configuration into the file.

# The eth beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain.service

[Unit]
Description=eth consensus layer beacon chain service
Wants=network-online.target
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
ExecStart=/home/ethereum/prysm/prysm.sh beacon-chain \
  --mainnet \
  --checkpoint-sync-url=https://beaconstate.info \
  --genesis-beacon-api-url=https://beaconstate.info \
  --execution-endpoint=http://localhost:8551 \
  --jwt-secret=/secrets/jwtsecret \
  --suggested-fee-recipient=0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS \
  --accept-terms-of-use

[Install]
WantedBy=multi-user.target

Checkpoint Sync: allows consensus layer to start within minutes instead of days.

  • Do not trust any single checkpoint provider. Verify the state root and block root against multiple checkpoints to ensure you're on the correct chain.

  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/beacon-chain.service

Run the following to enable auto-start at boot time and then start your beacon node service.

sudo systemctl daemon-reload
sudo systemctl enable beacon-chain
sudo systemctl start beacon-chain

Nice work. Your beacon chain is now managed by the reliability and robustness of systemd.

Store your prysm-only password in a file and make it read-only.

This is required so that Prysm can decrypt and load your validators.

Replace <my_password_goes_here> with your prysm-only password.

echo '<my_password_goes_here>' > /home/ethereum/.eth2validators/validators-password.txt
sudo chmod 600 /home/ethereum/.eth2validators/validators-password.txt

Verify your password is correct.

cat $HOME/.eth2validators/validators-password.txt

Clear the bash history in order to remove traces of your prysm-only password.

shred -u ~/.bash_history && touch ~/.bash_history


Create a systemd unit file to define your validator.service configuration.

sudo nano /etc/systemd/system/validator.service

Paste the following configuration into the file.

# The eth validator service (part of systemd)
# file: /etc/systemd/system/validator.service

[Unit]
Description=eth validator service
Wants=network-online.target beacon-chain.service
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
ExecStart=/home/ethereum/prysm/prysm.sh validator \
  --mainnet \
  --accept-terms-of-use \
  --wallet-password-file /home/ethereum/.eth2validators/validators-password.txt \
  --suggested-fee-recipient 0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS

[Install]
WantedBy=multi-user.target
  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/validator.service

Run the following to enable auto-start at boot time and then start your validator.

sudo systemctl daemon-reload
sudo systemctl enable validator
sudo systemctl start validator

Install curl and git.

sudo apt-get install gcc g++ make git curl -y

Install yarn.

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn -y

Confirm yarn is installed properly.

yarn --version
# Should output version >= 1.22.4

Install nodejs.

curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

Install and build Lodestar.

mkdir ~/git
cd ~/git
git clone -b stable https://github.com/chainsafe/lodestar.git
cd lodestar
yarn install --ignore-optional
yarn run build

This build process may take a few minutes.

Verify Lodestar was installed properly by displaying the version.

./lodestar --version

Setup a directory structure for Lodestar.

sudo mkdir -p /var/lib/lodestar
sudo chown ethereum:ethereum /var/lib/lodestar

Specific to your networking setup or cloud provider settings, ensure your validator's firewall ports are open and reachable.

  • Lodestar consensus client will use port 9000

  • Execution client requires port 30303

./lodestar validator import \
  --network mainnet \
  --dataDir /var/lib/lodestar \
  --keystore $HOME/staking-deposit-cli/validator_keys

Enter your keystore password to import accounts.

Confirm your keys were imported properly.

./lodestar validator list \
  --network mainnet \
  --dataDir /var/lib/lodestar

WARNING: Do not import your validator keys into multiple validator clients and run them at the same time, or you might get slashed. If moving validators to a new setup or different validator client, ensure deletion of the previous validator keys before continuing.

Run the beacon chain automatically with systemd.


🛠 Setup systemd service

Create a systemd unit file to define yourbeacon-chain.service configuration.

sudo nano /etc/systemd/system/beacon-chain.service

Paste the following configuration into the file.

# The eth2 beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain.service

[Unit]
Description=eth2 beacon chain service
Wants=network-online.target
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
WorkingDirectory=/home/ethereum/git/lodestar
ExecStart=/home/ethereum/git/lodestar/lodestar beacon \
  --network mainnet \
  --dataDir /var/lib/lodestar \
  --metrics true \
  --checkpointSyncUrl https://beaconstate.info \
  --jwt-secret /secrets/jwtsecret \
  --execution.urls http://127.0.0.1:8551 \
  --suggestedFeeRecipient 0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS

[Install]
WantedBy=multi-user.target

Checkpoint Sync: allows consensus layer to start within minutes instead of days.

  • Do not trust any single checkpoint provider. Verify the state root and block root against multiple checkpoints to ensure you're on the correct chain.

  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/beacon-chain.service

Run the following to enable auto-start at boot time and then start your beacon node service.

sudo systemctl daemon-reload
sudo systemctl enable beacon-chain
sudo systemctl start beacon-chain

Nice work. Your beacon chain is now managed by the reliability and robustness of systemd.

Create a systemd unit file to define your validator.service configuration.

sudo nano /etc/systemd/system/validator.service

Paste the following configuration into the file.

# The eth2 validator service (part of systemd)
# file: /etc/systemd/system/validator.service

[Unit]
Description=eth2 validator service
Wants=network-online.target beacon-chain.service
After=network-online.target
Documentation=https://www.coincashew.com

[Service]
Type=simple
User=ethereum
Restart=on-failure
WorkingDirectory=/home/ethereum/git/lodestar
ExecStart=/home/ethereum/git/lodestar/lodestar validator \
  --network mainnet \
  --dataDir /var/lib/lodestar \
  --suggestedFeeRecipient 0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS

[Install]
WantedBy=multi-user.target

  • Replace0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable, unlike the validator's attestation and block proposal rewards.

To exit and save, press Ctrl + X, then Y, thenEnter.

Update file permissions.

sudo chmod 644 /etc/systemd/system/validator.service

Run the following to enable auto-start at boot time and then start your validator.

sudo systemctl daemon-reload
sudo systemctl enable validator
sudo systemctl start validator

Nice work. Your validator is now managed by the reliability and robustness of systemd.

🗄 Viewing and filtering logs

#view and follow the log
journalctl --unit=beacon-chain -f
#view log since yesterday
journalctl --unit=beacon-chain --since=yesterday
#view log since today
journalctl --unit=beacon-chain --since=today
#view log between a date
journalctl --unit=beacon-chain --since='2020-12-01 00:00:00' --until='2020-12-02 12:00:00'

sudo systemctl status beacon-chain

sudo systemctl reload-or-restart beacon-chain

sudo systemctl stop beacon-chain

🗄 Viewing and filtering logs

#view and follow the log
journalctl --unit=validator -f
#view log since yesterday
journalctl --unit=validator --since=yesterday
#view log since today
journalctl --unit=validator --since=today
#view log between a date
journalctl --unit=validator --since='2020-12-01 00:00:00' --until='2020-12-02 12:00:00'

sudo systemctl status validator

sudo systemctl reload-or-restart validator

sudo systemctl stop validator

Sync Timeline: Syncing the consensus client is instantaneous with checkpoint sync but the execution client can take up to 1 week. On high-end machines with gigabit internet, expect your node to be fully syncing to take less than a day.

Patience required: If you're checking the logs and see any warnings or errors, please be patient as these will normally resolve once both your execution and consensus clients are fully synced to the Ethereum network.

How do I know I'm fully synced?

    • Check EL logs: journalctl -fu eth1

    • Check CL logs: journalctl -fu beacon-chain

Activated: When you're activated, your validator will begin creating and voting on blocks while earning staking rewards.

  • Subscribe to your Execution Client and Consensus Client's Github repository to be notified of new releases. Hit the Notifications button.

  • Support us on Gitcoin Grants: We build this guide exclusively by community support!

Last Words

I stand upon the shoulders of giants and as such, invite you to stand upon mine. Use my work with or without attribution; I make no claim of "intellectual property." My ideas are the result of countless millenia of evolution - they belong to humanity.

4.3. Import validator key

4.4. Configure port forwarding and/or firewall

4.5. Start the beacon chain

Refer to and feel free to pick one of the random state providers from the list, instead of the above endpointhttps://beaconstate.info

4.6. Start the validator

is a research project and a client implementation for Ethereum 2.0 designed to perform well on embedded systems and personal mobile devices, including older smartphones with resource-restricted hardware. The Nimbus team are from the company best known for by the same name. Nimbus (Apache 2) is written in Nim, a language with Python-like syntax that compiles to C.

4.1. Build Nimbus from source

4.2. Import validator key

4.3. Configure port forwarding and/or firewall

4.4. Start the beacon chain and validator

Refer to and feel free to pick one of the random state providers from the list, instead of the endpointhttps://beaconstate.info

(formerly known as Artemis) is a Java-based Ethereum 2.0 client designed & built to meet institutional needs and security requirements. PegaSys is an arm of dedicated to building enterprise-ready clients and tools for interacting with the core Ethereum platform. Teku is Apache 2 licensed and written in Java, a language notable for its maturity & ubiquity.

4.1 Build Teku from source

4.2. Configure port forwarding and/or firewall

4.3. Configure the beacon chain and validator

Refer to and feel free to pick one of the random state providers from the list, instead of the above endpointhttps://beaconstate.info

4.4 Import validator key

4.5. Start the beacon chain and validator

Setup systemd service

is a Go implementation of Ethereum 2.0 protocol with a focus on usability, security, and reliability. Prysm is developed by , a company with the sole focus on the development of their client. Prysm is written in Go and released under a GPL-3.0 license.

4.1. Install Prysm

4.2. Configure port forwarding and/or firewall

4.3. Import validator key

4.4. Start the beacon chain

Setup systemd service

Refer to and feel free to pick one of the random state providers from the list, instead of the above endpointhttps://beaconstate.info

4.5. Start the validator

Setup systemd service

is a Typescript implementation of the official by the team. In addition to the beacon chain client, the team is also working on 22 packages and libraries. A complete list can be found . Finally, the Lodestar team is leading the Eth2 space in light client research and development and has received funding from the EF and Moloch DAO for this purpose.

4.1 Build Lodestar from source

4.2. Configure port forwarding and/or firewall

4.3. Import validator key

4.4. Start the beacon chain and validator

Refer to and feel free to pick one of the random state providers from the list, instead of the above endpointhttps://beaconstate.info

4.5. Start the validator

Setup systemd service

Helpful Consensus Client systemd commands

View the status of the beacon chain

Restarting the beacon chain

Stopping the beacon chain

View the status of the validator

Restarting the validator

Stopping the validator

Next Steps

Check your execution client's logs and compare the block number against the most recent block on

Check your consensus client's logs and compare the slot number against the most recent slot on

Activation Queue: Once your EL+CL is synced, validator up and running, you just wait for activation. This process can take 24+ hours. Only 900 new validators can join per day. Check the queue length:

Quick monitoring: Use to create alerts and track your validator's performance.

Congrats! You've finished the primary steps of setting up your validator. You're now an Ethereum staker!

Recommended Steps

Join the to discuss all things staking related.

Familiarize yourself with section, as you'll need to keep your staking node running at its best.

Up your staking understanding with the

Optional Steps

Setup

Setup

Setup

Setup for extra staking rewards!

Familiarize yourself with section, as you dive deeper into staking.

Need extra live support?

Find Ethstaker frens on the Discord and Discord.

Use reddit: , or , or

Like these guides?

Audience-funded guide: If you found this helpful,

Feedback or pull-requests:

📜
🎩
🔥
⛓️
🧬
⚙️
🎩
🔥
🏂
⚙️
🔥
🏂
🎩
🏁
🛠️
⚙️
🔥
🎩
🏂
🛠️
🧬
🛠️
⚙️
🔥
🎩
🏂
🧬
🛠️
🛠️
🔎
🔄
🛑
🔎
🔄
🛑
⏭️
🎉
👍
🏁
☎️
💟
🛡️
🛡️
⚙️
💡
https://clientdiversity.org
Lighthouse
Nimbus
Teku
Prysm
Lodestar
Lighthouse
Sigma Prime
https://eth-clients.github.io/checkpoint-sync-endpoints/
Nimbus
Status
their messaging app/wallet/Web3 browser
https://eth-clients.github.io/checkpoint-sync-endpoints/
PegaSys Teku
ConsenSys
https://eth-clients.github.io/checkpoint-sync-endpoints/
Prysm
Prysmatic Labs
https://eth-clients.github.io/checkpoint-sync-endpoints/
Lodestar
Ethereum 2.0 specification
ChainSafe.io
here
https://eth-clients.github.io/checkpoint-sync-endpoints/
etherscan.io
beaconcha.in
https://wenmerge.com
https://beaconcha.in/
Part II - Maintenance
EthStaker Knowledge Base
Monitoring with Grafana and Prometheus
Mobile App Notifications and Monitoring by beaconcha.in
External Monitoring with Uptime Check by Google Cloud
MEV-boost
Part III - Tips
Ethstaker
coincashew
r/Ethstaker
DMs
r/coincashew
🙏
please consider supporting it directly.
https://github.com/coincashew/coincashew
community on Discord and Reddit
This is Leslie, the official mascot of Eth Staking