Lodestar VC
Create a new user account
Installing dependencies - Docker
The script below performs the following:
Download and run the official Docker installation script
Creates a new user group called "docker"
Adds your current Linux user account to this new docker group
Log out and then back in again for the new user group settings to take effect.
Create a new Lodestar user account
*Skip this step if you are using the Lodestar consensus client.
Prepare the validator data directory
1) Create 3 new folders to store the validator client data, validator keystore, and the validator keystore password
2) Copy the validator keystores and it's password file into their respective folders
3) Change the owner of these new folders to the lodestar
user
4) Restrict permissions on this new folder such that only the owner is able to read, write, and execute files in this folder
5) Retrieve the UID and GID of the lodestar
user account to be used in your docker-compose.yml
file in the next step
Aside from the file extension, the validator_keystore_password file will need to be named identically as the validator signing keystore file (e.g. keystore-m-123.json, keystore-m-123.txt)
Expected output:
New folders created:
Downloading Lodestar
Create a new folder for the Lodestar validator client.
Create a docker-compose.yml
file in the Lodestar folder.
Paste the following configuration into the docker-compose.yml
file. Note: This is similar to the systemd
configuration file used in the setup of other clients in this curriculum.
Once you're done, save with Ctrl+O
and Enter
, then exit with Ctrl+X
.
Now, let's break down what we are configuring in this yml
file.
image: chainsafe/lodestar:latest
: Pull and run the latest stable release of Lodestarcontainer_name: lodestar_validator
: Name given to this docker container, which can be up to you.restart: unless-stopped
: Automatically restarts this container when your device restarts unless explicitly stopped by the user.volumes:
: Binds the folders on your host machine to the folders in the docker container so that they are accessible by the docker container. Here, we are binding the folders used by the--dataDir,
--importKeystores
, and--importKeystoresPassword
flagsnetwork_mode: host
: Enables the docker container to share the network namespace with the host -i.e.
localhost
refers to both the host and the docker container, ports are shared between the host and the docker container
command:
: The flags to run the Lodestar with. Similar to flags used in the systemd configuration method.Each
-
indicates a line breakVariables with a
--
prefix are flags and the others are the values to the flagsThe first value (
validator
) instructs Lodestar to run only the consensus client and without the validator client--dataDir
: Specify the directory for Lodestar to store data related to the validator client--network
: Run the Validator Client service on the ETH Holesky testnet.--beacon-nodes
: URLs to connect to the main and backup consensus clients if any. This needs to be the same IP address set in your consensus client. Refer back here if you don't remember it.--builder
: Required when using external builders to build blocks (e.g. MEV relays)--suggestedFeeRecipient
: ETH wallet address to receive rewards from block proposals and MEV bribes--doppelganger-detection
: Helps prevents slashing due to double signing by checking if your validator keys are already active on the network. Not a fool-proof solution.--metrics
: Enable metrics for monitoring--metrics.port
: Set the port for retrieving metrics--graffiti
: Optional text to display on-chain when your validator proposes a block
environment
: Tells Node.js to allow a larger amount of memory to be used before it starts garbage collection processes to free up memory.ports:
Maps the ports used by the docker container to the ports of the host device so that they are reachable via the 127.0.0.1 or localhost name spaces.
Start the Lodestar Validator Client container
1) Make sure you are in the same folder as the docker-compose.yml
file you created earlier.
2) Start the docker container.
Expected output:
3) Make sure there are no error messages by monitoring the logs for a few minutes.
Remove duplicates of validator keystores
To prevent configuration mistakes leading to double signing in the future, remove duplicate copies of the validator signing keystores once everything is running smoothly.
Resources
Git repository: https://github.com/ChainSafe/lodestar-quickstart.git
Documentation: https://chainsafe.github.io/lodestar/
Discord: https://discord.gg/7Gdb4nFh
Last updated