Skip to content

Installation

Docker Installation

The chainsafe/lodestar Docker Hub repository is maintained actively. It contains the lodestar CLI preinstalled.

Info

The Docker Hub image tagged as chainsafe/lodestar:next is run on CI every commit on our unstable branch. For stable releases, the image is tagged as chainsafe/lodestar:latest.

Ensure you have Docker installed by issuing the command:

docker -v

It should return a non error message such as Docker version xxxx, build xxxx.

Pull, run the image and Lodestar should now be ready to use

docker pull chainsafe/lodestar
docker run chainsafe/lodestar --help

Info

Docker is the recommended setup for Lodestar. Use our Lodestar Quickstart scripts with Docker for detailed instructions.

Build from Source

Prerequisites

Make sure to have Yarn installed. It is also recommended to install NVM (Node Version Manager) and use the LTS version (currently v20) of NodeJS.

Info

NodeJS versions older than the current LTS are not supported by Lodestar. We recommend running the latest Node LTS. It is important to make sure the NodeJS version is not changed after reboot by setting a default nvm alias default <version> && nvm use default.

Note

Node Version Manager (NVM) will only install NodeJS for use with the active user. If you intend on setting up Lodestar to run under another user, we recommend using NodeSource's source for NodeJS so you can install NodeJS globally.

Clone repository

Clone the repository locally and build from the stable release branch.

git clone -b stable https://github.com/chainsafe/lodestar.git

Switch to created directory.

cd lodestar

Install packages

Install across all packages. Lodestar follows a monorepo structure, so all commands below must be run in the project root.

yarn install

Build source code

Build across all packages.

yarn run build

Lodestar CLI

Lodestar should now be ready for use.

./lodestar --help

See Command Line Reference for further information.

Danger

For mainnet (production) usage, we only recommend installing with docker due to NPM supply chain attacks. Until a safer installation method has been found, do not use this install method except for experimental purposes only.