Dependency Graph
Lodestar Dependency Graph
This is a diagram of the various Lodestar packages in the monorepo, how they fit together and interact with major external dependencies:
This dependency graph only applies to dependencies as they are used in the src/
folders of each package, not in test/
Lodestar Monorepo
For a list of all the packages in the monorepo and a description for each, click here. Below is a brief summary of each package in alphabetical order.
@chainsafe/lodestar
@chainsafe/lodestar combines everything together for CLI usage and configuration of the beacon node and validator.
@lodestar/api
@lodestar/api contains a TypeScript REST client for the Ethereum Consensus API.
@lodestar/beacon-node
@lodestar/beacon-node contains the actual beacon node process itself, which is the aggregate of all the above packages and the "brain" of the Lodestar beacon chain implementation. All of the node modules live in this package as well.
@lodestar/config
@lodestar/config combines @lodestar/params
and @lodestar/types
together to be used as a single config object across the other Lodestar packages.
@lodestar/db
@lodestar/db is where all persistent data about the beacon node is stored. Any package that needs to read or write persistent beacon node data depends on @lodestar/db
.
@lodestar/flare
@lodestar/flare is a command tool used for easily triggering non-standard actions and debugging for researchers, developers and testers. Use with care.
@lodestar/fork-choice
@lodestar/fork-choice holds the methods for reading/writing the fork choice DAG. The @lodestar/beacon-node
package is the sole consumer of this package because the beacon node itself is what controls when the fork choice DAG is updated.
For a good explanation on how the fork choice itself works, see the annotated fork choice spec. This is an annotated version of the Ethereum Consensus fork choice spec which @lodestar/fork-choice
is based on.
@lodestar/light-client
@lodestar/light-client is our light client designed to interact with the Ethereum blockchain in a trust-minimized matter via the sync committee and the light-client protocol.
@lodestar/logger
@lodestar/logger is a common NodeJS logger for Lodestar binaries, which is required for worker threads to instantiate new loggers with consistent settings.
@lodestar/params
@lodestar/params contains the parameters for configuring an Ethereum Consensus network. For example, the mainnet params.
@lodestar/prover
@lodestar/prover is a web3 provider and a proxy to enable verification of JSON-RPC calls to the execution client using the light-client protocol.
@lodestar/reqresp
@lodestar/reqresp contains the TypeScript implementation of the Ethereum Consensus Req/Resp protocol.
@lodestar/spec-test-util
@lodestar/spec-test-util is a Vitest test utility harness used for adhering to the Ethereum Consensus specification tests.
@lodestar/state-transition
@lodestar/state-transition contains the Lodestar implementation of the beacon state transition function, which is used by @lodestar/beacon-node
to perform the actual beacon state transition. This package also contains various functions used to calculate info about the beacon chain (such as computeEpochAtSlot
) which are used by @lodestar/fork-choice
and @lodestar/validator
@lodestar/types
@lodestar/types contains Ethereum Consensus ssz types and data structures.
@lodestar/utils
@lodestar/utils contains various utilities that are common among the various Lodestar monorepo packages.
@lodestar/validator
@lodestar/validator contains the validator client. The sole consumer of this package is @chainsafe/lodestar
, which provides CLI access to run and configure the validator client. However, the validator client communicates to a REST API that is contained in @lodestar/beacon-node
(specifically in the api
module) to perform the validator duties.
External Dependencies
Below is a brief summary, listed alphabetically, of each of our main external dependencies managed externally from our monorepo.
@chainsafe/blst-ts
@chainsafe/blst-ts` is our TypeScript wrapper for @supranational/blst native bindings, a highly performant BLS12-381 signature library.
@chainsafe/discv5
@chainsafe/discv5 is our monorepo containing our TypeScript implementation of the discv5 Node Discovery Protocol v5.
@chainsafe/js-libp2p-gossipsub
@chainsafe/js-libp2p-gossipsub is an implementation of pubsub based on mmeshsub and floodsub. Specified under @libp2p/specs/pubsub/gossipsub.
@chainsafe/js-libp2p-noise
@chainsafe/js-libp2p-noise contains the TypeScript implementation of the Noise protocol, an encryption protocol used in @libp2p/specs/noise.
@chainsafe/js-libp2p-yamux
@chainsafe/js-libp2p-yamux contains the JavaScript implementation of the Yamux multiplexer from Hashicorp designed for usage with js-libp2p.
@chainsafe/ssz
@chainsafe/ssz contains the packages as a monorepo related to the Simple Serialize.
@libp2p/js-libp2p
@libp2p/js-libp2p is the JavaScript implementation of the libp2p networking stack used in Ethereum's networking stack.