Run Beacon Node: Lighthouse
This page's content is up-to-date for Lighthouse v4.2.0.
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.
Key Links
Visit Lighthouse's page on how to download Lighthouse.
- Lighthouse Repo: https://github.com/sigp/lighthouse
- Lighthouse Documentation: https://lighthouse-book.sigmaprime.io/
Gnosis maintains a repo with sample Lighthouse Dockerfiles and configs
Content | Link |
---|---|
Release Page | https://github.com/sigp/lighthouse/releases/ |
Docker Images | https://hub.docker.com/repository/docker/sigp/lighthouse/ |
Lighthouse Docs | https://lighthouse-book.sigmaprime.io/ |
Github Repo | https://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/
- Lighthouse's Checkpoint Sync docs
- Gnosis' Checkpoint Sync server Status
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.
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:
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:
- execution
- consensus
- validator
docker logs -f --tail 500 execution
docker logs -f --tail 500 consensus
docker logs -f --tail 500 validator
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