Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Setting up a development environment for ethrex

Prerequisites

Cloning the repo

The full code of ethrex is available at GitHub and can be cloned using git

git clone https://github.com/lambdaclass/ethrex && cd ethrex

Building the ethrex binary

Ethrex can be built using cargo

To build the client run

cargo build --release --bin ethrex

the following feature can be enable with --features <features>

FeatureDescription
defaultEnables "libmdbx", "c-kzg", "blst", "rollup_storage_sql", "dev", "metrics" features
debugEnables debug mode for LEVM
devMakes the --dev flag available
metricsEnables metrics gathering for use with a monitoring stack
c-kzgEnables the c-kzg crate instead of kzg-rs
blstEnables the blst crate
libmdbxEnables libmdbx as the database for the ethereum state
redbEnables redb as the database for the ethereum state
rollup_storage_libmdbxEnables libmdbx as the database for the L2 batch data
rollup_storage_redbEnables redb as the database for the L2 batch data
rollup_storage_sqlEnables sql as the database for the L2 batch data
sp1Enables the sp1 backend for the L2 prover
risc0Enables the risc0 backend for the L2 prover
gpuEnables CUDA support for the zk backends risc0 and sp1

Bolded are features enabled by default

Additionally the environment variable COMPILE_CONTRACTS can be set to true to enable embedding the solidity contracts used by the rollup, into the binary to enable the L2 dev mode.

Building the docker image

The Dockerfile is located at the root of the repository and can be built by running

docker build -t ethrex .

The BUILD_FLAGS argument can be used to pass flags to cargo, for example

docker build -t ethrex --build-arg BUILD_FLAGS="--features <features>" .