Install client
-
Find the latest stable version of Lighthouse on Github
- Find latest Lighthouse version at https://github.com/sigp/lighthouse/releases
-
Write latest stable lighthouse version:
This will update the url links in the guide below.
-
Download Lighthouse version
7.1.0
to your nodecd ~/downloads && curl -LO https://github.com/sigp/lighthouse/releases/download/v7.1.0/lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz
Extract downloaded file
tar xvf lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz
-
Replace old Lighthouse client for new
sudo cp ~/downloads/lighthouse /usr/local/bin
-
Remove downloaded files
cd ~/downloads && rm lighthouse-v7.1.0-x86_64-unknown-linux-gnu.tar.gz && rm -r lighthouse
Configurate the service
-
Create a user for lighthouse beacon
:sudo useradd --system --no-create-home --shell /bin/false lighthousebeacon
-
Create a directory for data
:sudo mkdir -p /var/lib/lighthouse/beacon
Set permission for accessing the directory
sudo chown -R lighthousebeacon:lighthousebeacon /var/lib/lighthouse/beacon
Communication ports selection
Each service on the server needs a custom port for communication. Through ports, consensus client communicates with other peers in the network as well as other services running on the server, such as validator clients. There is an IPv4 and IPv6 variant, depending on the ISP support / preference. Each protocol version needs custom port. If you are not sure what to select, continue with default IPv4 port.
-
Configurate public IPv4 port for P2P communication with other peers
- :
- Verify availability of selected port
9000
ss -tuln | grep ':9000'
If it returns empty response, the port
9000
is free and can be used. - Enable traffic on the port through UFW
sudo ufw allow 9000
- Disable IPv6 traffic on the port
- List allowed ports
sudo ufw status numbered
- Find order number for V6, see
9000 (V6)
and remove it with the following linesudo ufw delete <Number>
- List allowed ports
QUIC IPv4 port
- :
- Verify availability of selected port
9001
ss -tuln | grep ':9001'
If it returns empty response, the port
9001
is free and can be used. -
Beacon API port for internal communication
- :
- Verify availability of selected port
5052
ss -tuln | grep ':5052'
If it returns empty response, the port
5052
is free and can be used.
-
Configurate public IPv6 port for P2P communication with other peers
- :
- Verify availability of selected port
9090
ss -tuln | grep ':9090'
If it returns empty response, the port
9090
is free and can be used. - Enable traffic on the port through UFW
sudo ufw allow 9090
- Disable IPv6 traffic on the port
- List allowed ports
sudo ufw status numbered
- Find order number for V6, see
9090
and remove it with the following linesudo ufw delete <Number>
- List allowed ports
QUIC IPv6 port
- :
- Verify availability of selected port
9091
ss -tuln | grep ':9091'
If it returns empty response, the port
9091
is free and can be used.
-
Create configuration file for Lighthouse Beacon service
Open Lighthouse Beacon configuration file
sudo nano /etc/systemd/system/lighthousebeacon.service
Copy the configuration below into the file. If needed, check flags documentation.
Notes:[Unit] Description=Lighthouse Consensus Client BN (Ethereum Mainnet) Wants=network-online.target After=network-online.target [Service] User=lighthousebeacon Group=lighthousebeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/lighthouse bn \ --network mainnet \ --datadir /var/lib/lighthouse \ --http \ --execution-endpoint http://127.0.0.1:8551 \ --execution-jwt /var/lib/jwtsecret/ethereum.hex \ # --target-peers 80 \ --checkpoint-sync-url https://beaconstate.info \ --port 9000 \ --port6 9090 \ # --discovery-port 9000 \ --quic-port 9001 \ --quic-port6 9091 \ --http-port 5052 [Install] WantedBy=multi-user.target
- You can find all available flags at https://lighthouse-book.sigmaprime.io/help_bn.html
- Update
execution-jwt
, if you use different - You can uncomment
--target-peers
to reduce bandwidth - You can configurate
checkpoint-sync-url
for a quick synchronization from a selected Checkpoint sync endpoint. After enabling it, verify, that you are on on the expected chain, see https://beaconstate.info/ → Get started → Lighthouse - If you operate more nodes in the local network, you can configurate
--trusted-peers
flag. You can get peer_id from BeaconChain API throughPROTOCOL://IP:PORT/eth/v1/node/identity
` command.
[Unit] Description=Lighthouse Consensus Client BN (Gnosis Network) Wants=network-online.target After=network-online.target [Service] User=lighthousebeacon Group=lighthousebeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/lighthouse bn \ --network gnosis \ --datadir /var/lib/lighthouse \ # --subscribe-all-subnets \ --execution-endpoint http://localhost:8551 \ --execution-jwt /var/lib/jwtsecret/gnosis.hex \ # --target-peers 80 \ --checkpoint-sync-url https://checkpoint.gnosischain.com \ --http \ --port 9000 \ --port6 9090 \ # --discovery-port 9000 \ --quic-port 9001 \ --quic-port6 9091 \ --http-port 5052 [Install] WantedBy=multi-user.target
Notes:
- You can find all available flags at https://lighthouse-book.sigmaprime.io/help_bn.html
- Update
execution-jwt
, if you use different - You can uncomment
checkpoint-sync-url
for a quick synchronization from a checpoint. After enabling it, verify, that you are on on the expected chain, see https://checkpoint.gnosischain.com/ → Get started → Lighthouse - You can uncomment
--target-peers
to reduce bandwidth - If you operate more nodes in the local network, you can configurate
--trusted-peers
flag. You can get peer_id from BeaconChain API throughPROTOCOL://IP:PORT/eth/v1/node/identity
` command.
execution-jwt
, if you use differentPress
CTRL
+X
thenY
thenENTER
to save and exit the config file.Load changes made in config files to the system
sudo systemctl daemon-reload
Launch the service
- Start the service
sudo systemctl start lighthousebeacon
- Check the state
systemctl status lighthousebeacon && journalctl -fu lighthousebeacon
-
Activate service to start automatically
sudo systemctl enable lighthousebeacon
Note
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.sh
Configurate service start inside it
systemctl start lighthousebeacon.service
- Be sure,
delayed-start.service
service controllingdelayed-start.sh
is enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
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:
beaconServices="lighthousebeacon"
If you place more services to the category, separate them with a space, see
beaconServices="service1 service2 service3 ..."
- Open the configuration file
-
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 beacon client(s)
/usr/local/bin/staking.sh start beacon
- Verify, that a service `
delayed-start.service
` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell