NodeBridgeAfrica
  • 😌Home
  • About Us
  • 🔔Community Code of Conduct
  • 🚀Support Nodebridge Africa
  • 🚫Disclaimer
  • Understanding Blockchain
  • Consensus Mechanism in Blockchain
  • Understanding Staking and Node
  • Node Operator vs. Validator: Understanding the Differences
    • Node Operator and Validator
    • Roles & Responsibilities of an Ethereum node operator
    • Skillset Required
    • Understanding the Ethereum Validator Process
  • Rewards and Penalties for Ethereum Validators
  • Client Diversity
  • Bonded Validators
  • Node Setup and Configuration Guide
  • Hardware & System Requirements
    • Initial Setup
      • Hardware Requirements
      • Internet Requirement
      • Configure time sync
    • Practicing on Cloud VMs
    • Install and prepare the OS
    • Node Security: Root, Networking & Network Security
    • Advanced networking
  • Introduction to ETH Validators
  • NodeBridge Africa Community
    • Setting Up an Ethereum Validator Node In Africa
  • Staking Guide
    • Ethereum Staking Guide
      • Ethereum Guide
        • Guide: How to Setup a validator on Holesky Testnet
          • Overview - Manual Installation
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Installing execution client
            • Besu
            • Erigon
            • Geth
            • Nethermind
            • Reth
          • Step 4: Installing consensus client
            • Lighthouse
            • Lodestar
            • Nimbus
            • Prysm
            • Teku
          • Step 5: Installing Validator
            • Installing Validator
              • Lighthouse
              • Lodestar
              • Nimbus
              • Prysm
              • Teku
            • Setting up Validator Keys
            • Next Steps
          • Maintenance
            • Updating Execution Client
            • Updating Consensus Client
            • Uninstalling Staking Node
            • Backups Checklist: Critical Staking Node Data
        • Guide | How to setup a validator for Ethereum staking on mainnet
          • Overview - Manual Installation
          • PART I - INSTALLATION
          • PART I - INSTALLATION
            • Step 1: Prerequisites
            • Step 2: Configuring Node
            • Step 3: Installing execution client
              • Besu
              • Erigon
              • Geth
              • Nethermind
              • Reth
            • Step 4: Installing consensus client
              • Lighthouse
              • Lodestar
              • Nimbus
              • Prysm
              • Teku
            • Step 5: Installing Validator
              • Installing Validator
                • Lighthouse
                • Lodestar
                • Nimbus
                • Prysm
                • Teku
              • Setting up Validator Keys
              • Next Steps
            • Synchronizing time with Chrony
            • Monitoring with Uptime Check by Google Cloud
            • Mobile App Node Monitoring by beaconcha.in
            • Monitoring your validator with Grafana and Prometheus
            • Security Best Practices for your ETH staking validator node
          • PART II - MAINTENANCE
          • PART II - MAINTENANCE
            • Updating Consensus Client
            • Updating Execution Client
            • Finding the longest attestation slot gap
            • Backups Checklist: Critical Staking Node Data
            • Checking my eth validator's sync committee duties
            • Checklist | Confirming a healthy functional ETH staking node
            • Uninstalling Staking Node
          • PART III - TIPS
          • PART III - TIPS
            • Voluntary Exiting a Validator
            • Verifying Your Mnemonic Phrase
            • Adding a New Validator to an Existing Setup with Existing Seed Words
            • How to re-sync using checkpoint sync
            • Dealing with Storage Issues on the Execution Client
            • Disk Usage by Execution / Consensus Client
            • EIP2333 Key Generator by iancoleman.io
            • Geth - Enabling path-based state storage
            • Important Directory Locations
            • Improving Validator Attestation Effectiveness
            • Reducing Network Bandwidth Usage
            • Running a slasher
            • Setting up dynamic DNS (DDNS)
            • Switching / Migrating Execution Client
            • Switching / Migrating Consensus Client
            • Using All Available LVM Disk Space
            • Using Node as RPC URL endpoint
        • Guide: How to stake on ETH 2.0 Altona Testnet with Lighthouse on Ubuntu
        • Guide | How to setup a validator on ETH2 mainnet
        • Guide | MEV-boost for Ethereum Staking
          • MEV Relay List
        • Security Best Practices for your ETH staking validator node
        • Guide | Recover Ethereum Validator Mnemonic Seed
        • Update Withdrawal Keys for Ethereum Validator (BLS to Execution Change or 0x00 to 0x01) with ETHDO
        • Downloading files from your node
      • TIPS
    • Gnosis Staking Guide
      • Guide: How to Setup a validator on Chiado Testnet
        • Overview - Manual Installation
        • Step 1: Prerequisites
        • Step 2: Configuring Node
        • Step 3: Installing execution client
          • Besu
          • Erigon
          • Geth
          • Nethermind
          • Reth
        • Step 4: Installing consensus client
          • Lighthouse
          • Lodestar
          • Nimbus
          • Teku
        • Step 5: Installing Validator
          • Installing Validator
            • Lighthouse
            • Lodestar
            • Nimbus
            • Prysm
            • Teku
          • Setting up Validator Keys
          • Next Steps
        • Maintenance
          • Updating Execution Client
          • Updating Consensus Client
          • Uninstalling Staking Node
          • Backups Checklist: Critical Staking Node Data
      • Guide | How to setup a validator for Gnosis staking on mainnet
        • Overview - Manual Installation
        • PART I - INSTALLATION
        • PART I - INSTALLATION
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Installing execution client
            • Besu
            • Erigon
            • Geth
            • Nethermind
            • Reth
          • Step 4: Installing consensus client
            • Lighthouse
            • Lodestar
            • Nimbus
            • Prysm
            • Teku
          • Step 5: Installing Validator
            • Installing Validator
              • Lighthouse
              • Lodestar
              • Nimbus
              • Prysm
              • Teku
            • Setting up Validator Keys
            • Next Steps
          • Synchronizing time with Chrony
          • Monitoring with Uptime Check by Google Cloud
          • Mobile App Node Monitoring by beaconcha.in
          • Monitoring your validator with Grafana and Prometheus
          • Security Best Practices for your ETH staking validator node
        • PART II - MAINTENANCE
        • PART II - MAINTENANCE
          • Updating Consensus Client
          • Updating Execution Client
          • Finding the longest attestation slot gap
          • Backups Checklist: Critical Staking Node Data
          • Checking my eth validator's sync committee duties
          • Checklist | Confirming a healthy functional ETH staking node
          • Uninstalling Staking Node
        • PART III - TIPS
        • PART III - TIPS
          • Voluntary Exiting a Validator
          • Verifying Your Mnemonic Phrase
          • Adding a New Validator to an Existing Setup with Existing Seed Words
          • How to re-sync using checkpoint sync
          • Dealing with Storage Issues on the Execution Client
          • Disk Usage by Execution / Consensus Client
          • EIP2333 Key Generator by iancoleman.io
          • Geth - Enabling path-based state storage
          • Important Directory Locations
          • Improving Validator Attestation Effectiveness
          • Reducing Network Bandwidth Usage
          • Running a slasher
          • Setting up dynamic DNS (DDNS)
          • Switching / Migrating Execution Client
          • Switching / Migrating Consensus Client
          • Using All Available LVM Disk Space
          • Using Node as RPC URL endpoint
      • Security Best Practices for your ETH staking validator node
    • Lido Community Staking Module(CSM) and Obol DVT Guide
      • Guide: How to Setup a validator on Chiado Testnet
        • Overview - Manual Installation
        • Step 1: Prerequisites
        • Step 2: Configuring Node
        • Step 3: Installing execution client
          • Besu
          • Erigon
          • Geth
          • Nethermind
          • Reth
        • Step 4: Installing consensus client
          • Lighthouse
          • Lodestar
          • Nimbus
          • Teku
        • Step 5: Installing Validator
          • Installing Validator
            • Lighthouse
            • Lodestar
            • Nimbus
            • Prysm
            • Teku
          • Setting up Validator Keys
          • Next Steps
        • Maintenance
          • Updating Execution Client
          • Updating Consensus Client
          • Uninstalling Staking Node
          • Backups Checklist: Critical Staking Node Data
      • Guide | How to setup a validator for Gnosis staking on mainnet
        • Overview - Manual Installation
        • PART I - INSTALLATION
        • PART I - INSTALLATION
          • Step 1: Prerequisites
          • Step 2: Configuring Node
          • Step 3: Installing execution client
            • Besu
            • Erigon
            • Geth
            • Nethermind
            • Reth
          • Step 4: Installing consensus client
            • Lighthouse
            • Lodestar
            • Nimbus
            • Prysm
            • Teku
          • Step 5: Installing Validator
            • Installing Validator
              • Lighthouse
              • Lodestar
              • Nimbus
              • Prysm
              • Teku
            • Setting up Validator Keys
            • Next Steps
          • Synchronizing time with Chrony
          • Monitoring with Uptime Check by Google Cloud
          • Mobile App Node Monitoring by beaconcha.in
          • Monitoring your validator with Grafana and Prometheus
          • Security Best Practices for your ETH staking validator node
        • PART II - MAINTENANCE
        • PART II - MAINTENANCE
          • Updating Consensus Client
          • Updating Execution Client
          • Finding the longest attestation slot gap
          • Backups Checklist: Critical Staking Node Data
          • Checking my eth validator's sync committee duties
          • Checklist | Confirming a healthy functional ETH staking node
          • Uninstalling Staking Node
        • PART III - TIPS
        • PART III - TIPS
          • Voluntary Exiting a Validator
          • Verifying Your Mnemonic Phrase
          • Adding a New Validator to an Existing Setup with Existing Seed Words
          • How to re-sync using checkpoint sync
          • Dealing with Storage Issues on the Execution Client
          • Disk Usage by Execution / Consensus Client
          • EIP2333 Key Generator by iancoleman.io
          • Geth - Enabling path-based state storage
          • Important Directory Locations
          • Improving Validator Attestation Effectiveness
          • Reducing Network Bandwidth Usage
          • Running a slasher
          • Setting up dynamic DNS (DDNS)
          • Switching / Migrating Execution Client
          • Switching / Migrating Consensus Client
          • Using All Available LVM Disk Space
          • Using Node as RPC URL endpoint
      • Security Best Practices for your ETH staking validator node
  • Introduction to SSV.Network
  • Awesome Resources
Powered by GitBook
On this page
  • Overview
  • 1. Initial configuration
  • 2. Install Binaries
  • 3. Setup and configure systemd
  • 4. Helpful consensus client commands
  1. Staking Guide
  2. Lido Community Staking Module(CSM) and Obol DVT Guide
  3. Guide: How to Setup a validator on Chiado Testnet
  4. Step 4: Installing consensus client

Teku

PreviousNimbusNextStep 5: Installing Validator

Last updated 8 months ago

Overview

(formerly known as Artemis) is a Java-based Ethereum 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 materity & ubiquity.

Note: Teku is configured to run both validator client and beacon chain client in one process.

Official Links

Subject
Links

Releases

Documentation

Website

1. Initial configuration

Create a service user for the consensus service, create data directory and assign ownership.

sudo adduser --system --no-create-home --group consensus
sudo mkdir -p /var/lib/teku
sudo chown -R consensus:consensus /var/lib/teku

Install dependencies.

sudo apt install curl ccze openjdk-17-jdk libsnappy-dev libc6-dev jq git libc6 unzip -y

2. Install Binaries

  • Downloading binaries is often faster and more convenient.

  • Building from source code can offer better compatibility and is more aligned with the spirit of FOSS (free open source software).

Option 1 - Download binaries

Run the following to automatically download the latest linux release, un-tar and cleanup.

RELEASE_URL="https://api.github.com/repos/ConsenSys/teku/releases/latest"
LATEST_TAG="$(curl -s $RELEASE_URL | jq -r ".tag_name")"
BINARIES_URL="https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/${LATEST_TAG}/teku-${LATEST_TAG}.tar.gz"
echo Downloading URL: $BINARIES_URL

cd $HOME
# Download
wget -O teku.tar.gz $BINARIES_URL
# Untar
tar -xzvf teku.tar.gz -C $HOME
# Rename folder
mv teku-* teku
# Cleanup
rm teku.tar.gz

Install the binaries.

sudo mv $HOME/teku /usr/local/bin/teku
Option 2 - Build from source code

Build the binaries.

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

Verify Teku was built properly by displaying the version.

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

Install the binaries.

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

3. Setup and configure systemd

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

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

Paste the following configuration into the file.

[Unit]
Description=Teku Beacon Node Consensus Client service for Holesky
Wants=network-online.target
After=network-online.target
Documentation=https://www.nodebridgeafrica.com

[Service]
Type=simple
User=consensus
Group=consensus
Restart=on-failure
RestartSec=3
KillSignal=SIGINT
TimeoutStopSec=900
Environment=JAVA_OPTS=-Xmx6g
Environment=TEKU_OPTS=-XX:-HeapDumpOnOutOfMemoryError
ExecStart=/usr/local/bin/teku/bin/teku \
  --network=holesky \
  --data-path=/var/lib/teku/ \
  --data-storage-mode="minimal" \
  --initial-state="https://holesky.beaconstate.ethstaker.cc" \
  --ee-endpoint=http://127.0.0.1:8551 \
  --ee-jwt-secret-file=/secrets/jwtsecret \
  --rest-api-enabled=true \
  --rest-api-port=5052 \
  --p2p-port=9000 \
  --p2p-peer-upper-bound=100 \
  --p2p-peer-lower-bound=60 \
  --metrics-enabled=true \
  --metrics-port=8008 \
  --validators-proposer-default-fee-recipient=<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS>

[Install]
WantedBy=multi-user.target
  • 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.

  • Not staking? If you only want a full node, delete the line beginning with

--validators-proposer-default-fee-recipient

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

[Unit]
Description=Teku Beacon Node + Validator Consensus Layer Client service for Holesky
Wants=network-online.target
After=network-online.target
Documentation=https://www.nodebridgeafrica.com

[Service]
Type=simple
User=consensus
Group=consensus
Restart=on-failure
RestartSec=3
KillSignal=SIGINT
TimeoutStopSec=900
Environment=JAVA_OPTS=-Xmx6g
Environment=TEKU_OPTS=-XX:-HeapDumpOnOutOfMemoryError
ExecStart=/usr/local/bin/teku/bin/teku \
  --network=holesky \
  --data-path=/var/lib/teku/ \
  --data-storage-mode="minimal" \
  --initial-state="https://holesky.beaconstate.ethstaker.cc" \
  --ee-endpoint=http://127.0.0.1:8551 \
  --ee-jwt-secret-file=/secrets/jwtsecret \
  --rest-api-enabled=true \
  --rest-api-port=5052 \
  --p2p-port=9000 \
  --p2p-peer-upper-bound=100 \
  --p2p-peer-lower-bound=60 \
  --metrics-enabled=true \
  --metrics-port=8008 \
  --validator-keys=/var/lib/teku/validator_keys:/var/lib/teku/validator_keys \
  --validators-graffiti="🏠🥩🪙🛡️" \
  --validators-proposer-default-fee-recipient=<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS>

[Install]
WantedBy=multi-user.target
  • 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.

  • Not staking? If you only want a full node, delete the whole three lines beginning with

--validator-keys
--validators-graffiti
--validators-proposer-default-fee-recipient

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

Run the following to enable auto-start at boot time.

sudo systemctl daemon-reload
sudo systemctl enable consensus

Finally, start your consensus layer client and check it's status.

sudo systemctl start consensus
sudo systemctl status consensus

Press Ctrl + C to exit the status.

Check your logs to confirm that the consensus clients are up and syncing.

sudo journalctl -fu consensus | ccze

Example of Synced Consensus Client Logs

teku[64122]: 02:24:28.010 INFO  - Slot Event  *** Slot: 19200, Block: 1468A43F874EDE790DB6B499A51003500B5BA85226E9500A7A187DB9A169DE20, Justified: 1132, Finalized: 1133, Peers: 70
teku[64122]: 02:24:40.010 INFO  - Slot Event  *** Slot: 19200, Block: 72B092AADFE146F5D3F395A720C0AA3B2354B2095E3F10DC18F0E9716D286DCB, Justified: 1132, Finalized: 1133, Peers: 70

4. Helpful consensus client commands

sudo journalctl -fu consensus | ccze

Example of Synced Teku Consensus Client Logs

teku[64122]: 02:24:28.010 INFO  - Slot Event  *** Slot: 19200, Block: 1468A43F874EDE790DB6B499A51003500B5BA85226E9500A7A187DB9A169DE20, Justified: 1132, Finalized: 1133, Peers: 70
teku[64122]: 02:24:40.010 INFO  - Slot Event  *** Slot: 19200, Block: 72B092AADFE146F5D3F395A720C0AA3B2354B2095E3F10DC18F0E9716D286DCB, Justified: 1132, Finalized: 1133, Peers: 70
sudo systemctl stop consensus
sudo systemctl start consensus
sudo systemctl status consensus

Common reasons to reset the database can include:

  • To reduce disk space usage

  • To recover from a corrupted database due to power outage or hardware failure

  • To upgrade to a new storage format

sudo systemctl stop consensus
sudo rm -rf /var/lib/teku/beacon
sudo systemctl restart consensus

With checkpoint sync enabled, time to re-sync the consensus client should take only a minute or two.

Now that your consensus client is configured and started, you have a full node.

Proceed to the next step on setting up your validator client, which turns a full node into a staking node.

This configuration combines the beacon chain and validator into one running service. While it is simpler to manage and run, this configuration is less flexible when it comes to running EL+CL failover nodes or in times you wish to resync your execution client and temporarily use .

If you wanted to setup a full node, not a staking node, stop here! Congrats on running your own full node!

🎉
PegaSys Teku
ConsenSys
Rocket Pool's Rescue Node
https://github.com/ConsenSys/teku/releases
https://docs.teku.consensys.net/introduction
https://consensys.net/knowledge-base/ethereum-2/teku