Step-by-Step Guide to Building an ETH Node with Geth and Lighthouse

·

Introduction to Ethereum Node Setup

Ethereum's transition from Proof-of-Work (PoW) to Proof-of-Stake (PoS) requires running two client types: an execution client (formerly "Eth1") and a consensus client (formerly "Eth2"). This tutorial focuses on setting up a non-staking node using Geth (execution) and Lighthouse (consensus).

Key Components

Execution Clients

ClientLanguageOS SupportNetworksSync ModesStorage
GethGoLinux, Windows, macOSMainnet, TestnetsSnapshot, FullArchive/Pruned
NethermindC#Linux, Windows, macOSMainnet, TestnetsFast, FullArchive/Pruned
BesuJavaLinux, Windows, macOSMainnet, TestnetsFast, FullArchive/Pruned
ErigonGoLinux, Windows, macOSMainnet, TestnetsFullArchive/Pruned

Consensus Clients

ClientLanguageOS SupportNetworks
LighthouseRustLinux, Windows, macOSBeacon Chain, Testnets
LodestarTypeScriptLinux, Windows, macOSBeacon Chain, Testnets
NimbusNimLinux, Windows, macOSBeacon Chain, Testnets
PrysmGoLinux, Windows, macOSBeacon Chain, Testnets
TekuJavaLinux, Windows, macOSBeacon Chain, Testnets

👉 Why choose Geth + Lighthouse?


Hardware Requirements

Minimum Specifications

Recommended Setup (Used in This Guide)


Server Configuration

1. Update System Packages

sudo apt update && sudo apt dist-upgrade -y

2. Install Essential Tools

sudo apt install wget git screen liblz4-tool vim unzip -y

Installing Execution Client (Geth)

Steps:

  1. Navigate to /eth directory:

    mkdir /eth && cd /eth
  2. Download and install Geth:

    wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.12.0-e501b3b0.tar.gz
    tar -zxvf geth-linux-amd64-1.12.0-e501b3b0.tar.gz
    mv geth-linux-amd64-1.12.0-e501b3b0 geth
    rm *.tar.gz
  3. Verify installation:

    /eth/geth/geth version

👉 Optimizing Geth for speed


Installing Consensus Client (Lighthouse)

Steps:

  1. Download Lighthouse:

    wget https://github.com/sigp/lighthouse/releases/download/v4.2.0/lighthouse-v4.2.0-x86_64-unknown-linux-gnu.tar.gz
    tar -zxvf lighthouse-v4.2.0-x86_64-unknown-linux-gnu.tar.gz
    rm *.tar.gz
  2. Add to PATH:

    echo 'export PATH=/eth:/eth/geth:$PATH' >> /etc/profile
    source /etc/profile
  3. Verify installation:

    lighthouse --version

Launching the Node

1. Generate JWT Secret

sudo mkdir -p /secrets
openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwt.hex

2. Start Geth (Execution Client)

nohup geth --cache 32768 --datadir /data/ethereum \
--http --http.addr 0.0.0.0 --http.api "eth,net,engine,web3" \
--authrpc.jwtsecret /secrets/jwt.hex --maxpeers 2000 &

3. Start Lighthouse (Consensus Client)

nohup lighthouse bn --network mainnet \
--execution-endpoint http://127.0.0.1:8551 \
--execution-jwt /secrets/jwt.hex \
--checkpoint-sync-url https://sync-mainnet.beaconcha.in \
--http &

Monitoring Node Sync

Check Sync Status

geth attach http://127.0.0.1:8545
> eth.syncing  # Returns false when synced
> eth.blockNumber  # Current block height
> net.peerCount  # Connected peers

FAQ

Q1: How long does syncing take?

A: Typically 3-4 hours with fast SSD storage.

Q2: Why choose Geth + Lighthouse?

A: Geth is the most battle-tested execution client, while Lighthouse offers Rust-based efficiency.

Q3: Can I run this on a Raspberry Pi?

A: Not recommended—requires x86_64 architecture and significant resources.

Q4: How to reduce storage usage?

A: Use --prune flag in Geth (prunes historical state data).

👉 Troubleshooting common issues