Run an Ethereum full node with lighthouse and Erigon

Hardware requirements

From erigon, for Ethereum mainnet, you'll need

  1. SSD free space:
    • at least 3TB for archive node
    • 500GB for full node
  2. >16GB RAM

Start erigon

You'll probably want to change $HOME to some other directory where you have write access.

  1. Download binary from the release page. If you are running 64bit Linux, you can download using the following command
       mkdir -p $HOME/ergion/
       cd $HOME/ergion/
       wget -c https://github.com/ledgerwatch/erigon/releases/download/v2.30.0/erigon_2.30.0_linux_amd64.tar.gz
       tar -xzvf erigon_2.30.0_linux_amd64.tar.gz
       
  2. Start a full node, Erigon will automatically create a jwt file at $HOME/erigon/jwtsecret which will be required by lighthouse later.
       erigon \
        --datadir=$HOME/erigon-data \
        --private.api.addr=localhost:9090 \
        --authrpc.jwtsecret=$HOME/erigon/jwtsecret \
        --http \
        --ws \
        --http.api=engine,eth,erigon,web3,net,debug,trace,txpool,shh
       
  3. Erigon will download about 250GB data in the beginning.

Start lighthouse

  1. Download binary from the release page. If you are running 64bit Linux, you can download using the following command
       mkdir -p $HOME/lighthouse/
       cd ~/lighthouse/
       wget -c https://github.com/sigp/lighthouse/releases/download/v3.3.0/lighthouse-v3.3.0-x86_64-unknown-linux-gnu-portable.tar.gz
       tar -xzvf lighthouse-v3.3.0-x86_64-unknown-linux-gnu-portable.tar.gz
       
  2. Start a lighthouse, if the checkpoint URL no longer works you can search for another one at Ethereum Beacon Chain checkpoint sync endpoints
       lighthouse beacon_node \
           --network mainnet \
           --http \
           --datadir $HOME/lighthouse-data \
           --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io \
           --checkpoint-sync-url-timeout 60000  \
           --execution-endpoints http://127.0.0.1:8551  \
           --jwt-secrets="$HOME/lighthouse/jwtsecret"
       

    • You can start lighthouse and erigon at the same time.
    • It's fine to ignore the errors error: Failed to get remote head and new block ranges: EndpointError(FarBehind), ... which basically means your latest Erigon block is lagging behind.

Create system service

With systemd, we can start Erigon and Lighthouse as background services.

  • Create ~/.config/systemd/user/lighthouse.service with the following content:
    [Unit]
    Description=Lighthouse CL Client
    After=network.target network-online.target
    Wants=network-online.target
    
    [Service]
    ExecStart=$HOME/lighthouse/lighthouse beacon_node \
           --network mainnet \
           --http \
           --datadir $HOME/lighthouse-data \
           --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io \
           --checkpoint-sync-url-timeout 60000  \
           --execution-endpoints http://127.0.0.1:8551  \
           --jwt-secrets="$HOME/lighthouse/jwtsecret"
    
    
    Restart=always
    RestartSec=15s
    
    [Install]
    WantedBy=multi-user.target
    
  • Create ~/.config/systemd/user/erigon.service with the following content:
    [Unit]
    Description=Erigon Node
    After=network.target network-online.target
    Wants=network-online.target
    
    [Service]
    WorkingDirectory=$HOME/erigon
    ExecStart=$HOME/erigon/erigon \
        --datadir=$HOME/erigon-data \
        --private.api.addr=localhost:9090 \
        --authrpc.jwtsecret=$HOME/lighthouse/jwtsecret \
        --http \
        --ws \
        --http.api=engine,eth,erigon,web3,net,debug,trace,txpool,shh
    
    Restart=always
    RestartSec=15s
    
    [Install]
    WantedBy=multi-user.target
    
  • Reload and start the services
      systemctl  --user daemon-reload
      systemctl  --user enable --now erigon
      systemctl  --user enable --now lighthouse
      
  • Check the status of the process
      systemctl  --user status lighthouse
      systemctl  --user status erigon
      
  • Get the log
      journalctl --user -f -u lighthouse
      journalctl --user -f -u erigon
      
Comment