Skip to main content

Run Beacon Node: Lighthouse

Version check

This page's content is up-to-date for Lighthouse v4.2.0.

Prerequisites

The Beacon Node requires an Execution client in order to operate. See Step 2: Run Execution Client for more information.

Overview

Lighthouse is an Ethereum and Gnosis consensus layer client written in Rust by Sigma Prime.

Download Lighthouse

Visit Lighthouse's page on how to download Lighthouse.

https://lighthouse-book.sigmaprime.io/installation.html

Learn More about Lighthouse
info

Gnosis maintains a repo with sample Lighthouse Dockerfiles and configs

https://github.com/gnosischain/lighthouse-client

ContentLink
Release Pagehttps://github.com/sigp/lighthouse/releases/
Docker Imageshttps://hub.docker.com/repository/docker/sigp/lighthouse/
Lighthouse Docshttps://lighthouse-book.sigmaprime.io/
Github Repohttps://github.com/sigp/lighthouse

Checkpoint Sync

We recommend the use of Checkpoint sync to sync your Beacon Node quickly, and avoid long range attacks.

Gnosis provides a checkpoint sync server at https://checkpoint.gnosischain.com/.

# Usage
$ lighthouse bn
--checkpoint-sync-url https://checkpoint.gnosischain.com/
More about Checkpoint Sync

Option 1: Run as a System Process

Refer to Guide

Option 2: Run using Docker

Images are referenced under the following pattern sigp/lighthouse:{image-tag} with the image-tag referring to the image available on Docker Hub.

Most users should use the latest-modern tag, which corresponds to the latest stable release of Lighthouse with optimizations enabled. If you are running on older hardware then the default latest image bundles a portable version of Lighthouse which is slower but with better hardware compatibility.

caution

The Beacon Node requires an Execution client in order to operate. See Step 2: Run Execution Client for more information.

1. Folder Structure

Create new folders:

mkdir -p /home/$USER/gnosis/consensus/data

Including the folders from your Execution client, your folder structure should now look like:

/home/$USER/gnosis/
├── jwtsecret/
├── execution/
└── consensus/
└── data/

2. Docker Compose

Modify your docker-compose file with your favorite text editor and add the consensus container. The file should now look like:

/home/$USER/gnosis/docker-compose.yml
version: "3"
services:

execution:
# From Step 2
# ...

consensus:
container_name: consensus
image: sigp/lighthouse:latest-modern
restart: always
networks:
- gnosis_net
ports:
- 9000:9000/tcp # p2p
- 9000:9000/udp # p2p
- 5054:5054/tcp # metrics
expose:
- 4000 # http
volumes:
- /home/$USER/gnosis/consensus/data:/data
- /home/$USER/gnosis/jwtsecret/jwt.hex:/jwt.hex
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
command: |
lighthouse
beacon_node
--network=gnosis
--disable-upnp
--datadir=/data
--port=9000
--http
--http-address=0.0.0.0
--http-port=4000
--execution-endpoint=http://execution:8551
--execution-jwt=/jwt.hex
--checkpoint-sync-url=https://checkpoint.gnosischain.com/
logging:
driver: "local"

networks:
gnosis_net:
name: gnosis_net

3. Start Containers

Start the consensus layer client listed in the compose file:

cd /home/$USER/gnosis
docker-compose up -d

4. Monitor Logs

Check your logs for each service (execution and consensus) with:

docker logs -f --tail 500 execution

5. Updating your Node

To update, just pull the new images, then stop and restart your docker-compose file:

cd /home/$USER/gnosis
docker-compose pull
docker-compose stop
docker-compose up -d