Lodestar

Installing and configuring the Lodestar Beacon Node.

Lodestar

Lodestar is a consensus client implementation written in TypeScript. It is approachable for developers familiar with the JavaScript ecosystem and is actively maintained by ChainSafe.

🛡️ Role: Lodestar contributes significantly to client diversity by bringing the vast JavaScript/TypeScript developer community into the Ethereum consensus layer. While often used for light clients, it is a fully capable production-grade Beacon Node.


1. Download & Install

We will download the latest standalone binary from the official ChainSafe repository. This allows us to run Lodestar without installing the entire NodeJS runtime environment globally.

A. Create the Application Directory

Bash

# Create a folder for the binary
sudo mkdir -p /usr/local/lib/lodestar

# Download the latest Linux release (Check https://github.com/ChainSafe/lodestar/releases)
# Example for v1.22.0:
sudo wget https://github.com/ChainSafe/lodestar/releases/download/v1.22.0/lodestar-v1.22.0-linux-amd64.tar.gz -O lodestar.tar.gz

# Extract the archive
sudo tar -xvzf lodestar.tar.gz -C /usr/local/lib/lodestar

# Cleanup
rm lodestar.tar.gz

B. Set Permissions Ensure the ethereum user owns the directory and the binary is executable.

Bash

sudo chown -R ethereum:ethereum /usr/local/lib/lodestar
sudo chmod +x /usr/local/lib/lodestar/lodestar

2. Configure Systemd Service

We will configure Lodestar to run as a background service.

⚠️ Syntax Note: Lodestar flags are case-sensitive and typically use camelCase (e.g., --jwtSecret instead of --jwt-secret). Be careful when typing them.

Create the service file:

Bash

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

Paste the following configuration:

Ini, TOML

[Unit]
Description=Lodestar Consensus Client
After=network.target

[Service]
User=ethereum
Group=ethereum
Type=simple
Restart=always
RestartSec=5

# Execution Command
ExecStart=/usr/local/lib/lodestar/lodestar beacon \
  --network mainnet \
  --dataDir /home/ethereum/consensus \
  --execution.urls http://127.0.0.1:8551 \
  --jwtSecret /home/ethereum/jwt/jwt.hex \
  --checkpointSyncUrl https://beaconstate.info \
  --rest \
  --rest.address 0.0.0.0 \
  --rest.port 5052 \
  --metrics \
  --metrics.address 0.0.0.0 \
  --metrics.port 8008

# Resource Limits
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

🔍 Flag Explanation:

  • --execution.urls: Connection to the Geth/Nethermind Engine API.

  • --jwtSecret: The authentication token path.

  • --checkpointSyncUrl: Enables instant syncing from a trusted checkpoint.

  • --rest: Enables the API (Required for validator client connection).


3. Start the Service

Reload the systemd daemon and start the beacon node.

Bash

# Reload systemd configuration
sudo systemctl daemon-reload

# Enable Lodestar to start on boot
sudo systemctl enable lodestar

# Start the service
sudo systemctl start lodestar

4. Verify Status

Check the logs to ensure Lodestar is syncing.

Bash

sudo journalctl -fu lodestar

Expected Output:

  1. Connection: Connected to execution (Success! It found your EL).

  2. Sync: Validated checkpoint... indicates Checkpoint Sync is working.

  3. Operations: You will see logs regarding slots and attestations as it processes blocks.

Last updated