Lodestar

Overview

Lodestar is a Typescript implementation of the official Ethereum specification by the ChainSafe.io team. In addition to the beacon chain client, the team is also working on 22 packages and libraries. A complete list can be found here. Finally, the Lodestar team is leading in light client research and development and has received funding from the EF and Moloch DAO for this purpose.

1. Initial configuration

Create a service user for the consensus service, create data directory and assign ownership.

sudo adduser --system --no-create-home --group consensus
sudo mkdir -p /var/lib/lodestar
sudo chown -R consensus:consensus /var/lib/lodestar

Install dependencies.

sudo apt-get install gcc g++ make git curl -y

2. Install Binaries

  • Building from source code can offer better compatibility and is more aligned with the spirit of FOSS (free open source software).

Option 1 - Build from source code

Install yarn.

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn -y

Confirm yarn is installed properly.

yarn --version
# Should output version >= 1.22.19

Install nodejs.

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

Install and build Lodestar.

mkdir -p ~/git
cd ~/git
git clone -b stable https://github.com/chainsafe/lodestar.git
cd lodestar
yarn install
yarn run build

Verify Lodestar was installed properly by displaying the version.

./lodestar --version

Sample output of a compatible version.

🌟 Lodestar: TypeScript Implementation of the Ethereum Consensus Beacon Chain.
  * Version: v1.8.0/stable/a4b29cf
  * by ChainSafe Systems, 2018-2022

Install the binaries.

sudo cp -a $HOME/git/lodestar /usr/local/bin/lodestar

3. Setup and configure systemd

Create a systemd unit file to define your consensus.service configuration.

Paste the following configuration into the file.

  • Replace<0x_CHANGE_THIS_TO_MY_ETH_FEE_RECIPIENT_ADDRESS> with your own Ethereum address that you control. Tips are sent to this address and are immediately spendable.

  • Not staking? If you only want a full node, delete the whole line beginning with

To exit and save, press Ctrl + X, then Y, then Enter.

Run the following to enable auto-start at boot time.

Finally, start your consensus layer client and check it's status.

Press Ctrl + C to exit the status.

4. Helpful consensus client commands

Example of Synced Lodestar Consensus Client Logs

Now that your consensus client is configured and started, you have a full node.

Proceed to the next step on setting up your validator client, which turns a full node into a staking node.

If you wanted to setup a full node, not a staking node, stop here! Congrats on running your own full node! πŸŽ‰