Install Erigon client

One-page interactive guide to install Erigon client and configurate it for running on supported chain.

Disclaimer

This guide is for informational purposes only. The author nor website owner does not guarantee accuracy of the information in this guide and is not responsible for any damages or losses incurred by following the guide.

Erigon client can be used for staking on various supported chains. Client installation is always only one, used by services with an individual configuration (different service name, data path and ports in use).

Install Erigon client

Installing Erigon client

Erigon documentation: https://erigon.gitbook.io/erigon

  1. Find the latest stable version of Erigon on Github

  2. Download Erigon version

    cd ~/downloads && curl -LO https://github.com/erigontech/erigon/releases/download/v/erigon_v_linux_amd64v2.tar.gz
  3. Verify hash of donwnloaded file

    Get hash of downloaded file and compare it with official hashes
    sha256sum erigon_v_linux_amd64v2.tar.gz
    And check it compare to the provided hash for the file from https://github.com/erigontech/erigon/releases/download/v/erigon_v_checksums.txt (Note: The link links at version )
  4. Extract the downloaded package

    tar xvf erigon_v_linux_amd64v2.tar.gz
  5. Copy extracted Erigon library

    sudo cp -a erigon_v_linux_amd64v2 /usr/local/bin/erigonlib
  6. Remove downloaded files

    cd ~/downloads && rm -r erigon_v_linux_amd64v2.tar.gz && rm -r erigon_v_linux_amd64v2

Configurate the service

Create a system user and data directory for Erigon service

  • Create a user

    :
    sudo useradd --system --no-create-home --shell /bin/false erigon
  • Create a folder for Erigon data on network

    :
    sudo mkdir -p /var/lib/erigon
  • Set access permission and ownership for the Erigon data folder

    sudo chown -R erigon:erigon /var/lib/erigon

Configurate & Run Erigon Service

  • Choose ports for communication

    Change the default ports below if you are going to stake on more chains simultaneously (e.g. Ethereum and Gnosis at once) on the same machine. If you are going to stake only, you can keep the default ports. If you are changing the default ports, be sure that the newly selected port is not already in used. A port in used may be checked with following code:

    ss -tuln | grep ':PORT'
    • If it returns empty response, the port is free and can be used.

    Ports selection

    • (Default port: 30303)
    • (Default port: 8545)
    • (Default port: 8551)
  • Enable port for P2P communication (execution client)

    To allow execution client synchronization, there's need to enable P2P traffic to TCP (allows the node to connect to peers) and UDP (allows node discovery) port 30303. It may be done with following UFW setup:

    $ sudo ufw allow 30303
  • Create configuration file for Erigon service

    1. Open configuration file
      sudo nano /etc/systemd/system/erigon.service
    2. Copy the configuration below into the file
      [Unit]
      Description=Erigon Execution Client (Ethereum Mainnet)
      After=network.target
      Wants=network.target
      [Service]
      User=eth-erigon
      Group=eth-erigon
      Type=simple
      Restart=always
      RestartSec=5
      ExecStart=/usr/local/bin/erigonlib/erigon \
        --chain=mainnet \
        --datadir=/var/lib/erigon \
        --authrpc.jwtsecret=/var/lib/jwtsecret/ethereum.hex \
      #  --externalcl \
        --prune=htcr
      #  --private.api.addr= \
      #  --prune.r.before=11052984 
      [Install]
      WantedBy=default.target
      [Unit]
      Description=Erigon Execution Client (Gnosis Chain)
      After=network.target
      Wants=network.target
      [Service]
      User=gno-erigon
      Group=gno-erigon
      Type=simple
      Restart=always
      RestartSec=5
      ExecStart=/usr/local/bin/erigonlib/erigon \
        --chain=gnosis \
        --datadir=/var/lib/erigon \
        --authrpc.jwtsecret=/var/lib/jwtsecret/gnosis.hex \
      #  --externalcl \
        --prune=htcr
      #  --private.api.addr= \
      #  --prune.r.before=11052984 
      [Install]
      WantedBy=default.target
      *Note: Update JsonRpc.JwtSecretFile, if you use different
    3. Press CTRL + X then Y then ENTER to save and exit the config file.
  • Start the service

    sudo systemctl daemon-reload
    sudo systemctl start erigon
  • Check the service

    systemctl status erigon
    journalctl -fu erigon
  • Start the service on system startup

    sudo systemctl enable erigon