Add Lodestar validator

One-page interactive guide to install Lodestar 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. See more.

Launch validator instance / validator(s)

Validators are defined by validator keys. Based on the network you are going to stake on, check Gnosis validator keys / Ethereum validator keys generation guide.

  1. Do you want to create a new validation instance or extend exisiting instance for more validators?

    • Create a directory for validator instance data

      sudo mkdir -p /var/lib/lodestar/vi1
    • Enable accessing /var/lib/lodestar/vi1 for server user myserveruser

      sudo chown -R myserveruser:myserveruser /var/lib/lodestar/vi1
    • Load keystores to /var/lib/lodestar/vi1

      :

      Move to Lodestar client directory

      cd /usr/local/bin/lodestar
      ./lodestar validator import --network mainnet --importKeystores $HOME/keystores/ddk_i1 --dataDir /var/lib/lodestar/vi1

      ./lodestar validator import --network gnosis --importKeystores $HOME/keystores/ddk_i1 --dataDir /var/lib/lodestar/vi1

      • Insert keystores encryption password (the one used during keystores generation) on request
      • If there are keystores with different encryption password, repeat the process for each encryption password
    • Create a service user for the validator instance

      sudo useradd --system --no-create-home --shell /bin/false lodestar-vi1
    • Set ownership of /var/lib/lodestar/vi1 to lodestar-vi1 user

      sudo chown -R lodestar-vi1:lodestar-vi1 /var/lib/lodestar/vi1
    • Enable access to NodeJs for user lodestar-vi1

      :
      sudo usermod -aG nodejsusr lodestar-vi1
    • Create configuration service file for lodestar-vi1 service

      1. Open the configuration file

        sudo nano /etc/systemd/system/lodestar-vi1.service
      2. Copy the configuration below into the file.

        • :
          This can be get with command node -v

        [Unit]
        Description=Lodestar Validator Instance (Ethereum Mainnet)
        Wants=network-online.target
        After=network-online.target
        [Service]
        User=lodestar-vi1
        Group=lodestar-vi1
        Type=simple
        Restart=always
        RestartSec=5
        WorkingDirectory=/usr/local/bin/lodestar
        Environment="PATH=/home/nodejsusr/.nvm/versions/node/v22.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ExecStart=/usr/local/bin/lodestar/lodestar validator \
          --network mainnet \
          --dataDir /var/lib/lodestar/validators/i1 \
          --force \
          --beaconNodes http://127.0.0.1:9596 \
          --suggestedFeeRecipient 0xXXXXXXXXXXXXXXXX \
          --graffiti "Nethermind+Lodestar"
        [Install]
        WantedBy=multi-user.target

        Notes

        [Unit]
        Description=Lodestar Validator Instance (Gnosis Network)
        Wants=network-online.target
        After=network-online.target
        [Service]
        User=lodestar-vi1
        Group=lodestar-vi1
        Type=simple
        Restart=always
        RestartSec=5
        WorkingDirectory=/usr/local/bin/lodestar
        Environment="PATH=/home/nodejsusr/.nvm/versions/node/v22.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ExecStart=/usr/local/bin/lodestar/lodestar validator \
          --network gnosis \
          --dataDir /var/lib/lodestar/validators/i1 \
          --suggestedFeeRecipient 0xXXXXXXXXXXXXXXXX \
          --beaconNodes http://127.0.0.1:9596 \
          --force \
          --graffiti "Nethermind+Lodestar"
        [Install]
        WantedBy=multi-user.target

        Notes

      3. Press CTRL + X then Y then ENTER to save and exit the config file.
    • Adding validator instance to staking services manager

      If you use a staking manager client, add the new instance into it.

    • Stop running validator instance lodestar-vi1

      sudo systemctl stop lodestar-vi1
    • Extend /var/lib/lodestar/validators/i1 for new keystores

      ./lodestar validator import --network mainnet --importKeystores $HOME/keystores/ddk_i1 --dataDir /var/lib/lodestar/vi1

      ./lodestar validator import --network gnosis --importKeystores $HOME/keystores/ddk_i1 --dataDir /var/lib/lodestar/vi1

      • You will be requested to insert keystores encryption password (the one used during keystores generation)
      • If there are keystores with different encryption password, repeat the process for each encryption password
      • Already existing keystores in the directory will be skipped
  2. Load processed changes to the system

    sudo systemctl daemon-reload
  3. Start the validator instance

    sudo systemctl start lodestar-vi1
  4. Check the running validator instance

    systemctl status lodestar-vi1
    journalctl -fu lodestar-vi1
  5. Other configurations

    Activate service to start automatically on OS startup

    sudo systemctl enable lodestar-vi1
    • Open Delayed Start shell
      sudo nano /usr/local/bin/delayed-start.sh

      Configurate service start inside it

      systemctl start lodestar-vi1.service
    • Be sure, delayed-start.service service controlling delayed-start.sh is enabled for auto start with system startup
      sudo systemctl enable delayed-start.service
    1. Configurate Staking Manager util

      • Open the configuration file
        sudo nano /usr/local/etc/staking/config/clients.conf

        If the file is empty, generate it with command sudo /usr/local/bin/staking.sh init

      • Set link to proper service. It should be as follow:
        validatorServices="lodestar-vi1"

        If you place more services to the category, separate them with a space, see validatorServices="service1 service2 service3 ..."

    2. Activate service to start automatically on OS startup

      • Open Start with delay util
        sudo nano /usr/local/bin/delayed-start.sh
      • Place or uncomment a command to start the validator client(s)
        /usr/local/bin/staking.sh start validators
      • Verify, that a service `delayed-start.service` exists and is automatically launched on system start.
        sudo systemctl enable delayed-start.service

    Configurate Lodestar validator Log monitor service

    Log monitor service monitors the service log and process defined action (fixes) in a case of any issue detected.

    1. Check, whether the logmonitor util is installed:
      /usr/local/bin/logmonitor.sh version

      If the util is not installed, install Lodestar validator Log monitor from GitHub.

    2. Check defined Errors list for lodestarvalidator service
      sudo nano /usr/local/etc/lodestarvalidator_tracking_records.txt

      If not available, download it from GitHub. You can also modifiy it, if needed.

    3. Configurate the validator log monitor for service lodestar-vi1, see guide on Github.
    4. Place validator logmonitor service into /usr/local/bin/delayed-start.sh util to start it automatically on system startup
      1. Open delayed-start.sh
        sudo nano /usr/local/bin/delayed-start.sh
      2. Place validator logmonitor service into the file
        systemctl start lodestar-vi1_logmonitor

Any issue while running Lodestar client?

Check Lodestar client emergency page.

Install Lodestar client Update Lodestar client Emergency for Lodestar client Exit Lodestar validator