Files
nanoreth/docs/repo/layout.md
Bjerg 7dc96a0a99 docs: update repo layout (#241)
* docs: update repo layout

* docs: typo

* Update docs/repo/layout.md

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-24 03:42:24 -08:00

3.7 KiB

Project Layout

This repository contains several Rust crates that implement the different building blocks of an Ethereum node. The high-level structure of the repository is as follows:

Binaries

All binaries are stored in bin.

Primitives

These crates define primitive types or algorithms such as RLP.

Database

These crates are related to the database.

  • codecs: Different storage codecs.
  • libmdbx-rs: Rust bindings for libmdbx. A fork of an earlier Apache-licensed version of libmdbx-rs.
  • db: Strongly typed database bindings to LibMDBX containing read/write access to Ethereum state and historical data (transactions, blocks etc.)

Networking

These crates are related to networking (p2p and RPC), as well as networking protocols.

P2P

RPC

  • net/rpc-api: RPC traits
    • Supported transports: HTTP, WS, IPC
    • Supported namespaces: eth_, engine_, debug_
  • net/rpc: Implementation of all ETH JSON RPC traits defined in rpc-api.
  • net/rpc-types: Types relevant for the RPC endpoints above, grouped by namespace

Downloaders

Ethereum

These crates are Ethereum-specific (e.g. EVM, consensus, transaction pools).

  • executor: Blazing-fast instrumented EVM using revm. Used during consensus, syncing & during transaction simulation / gas estimation.
  • consensus: Implementations of consensus protocols.
  • transaction-pool: An in-memory pending transactions pool.

Staged sync

These crates are related to staged sync.

  • stages: The staged sync pipeline, including implementations of each stage.

Misc

Small utility crates.

  • interfaces: Traits containing common abstractions across the components used in the system. For ease of unit testing, each crate importing the interface is recommended to create mock/in-memory implementations of each trait.
  • tracing: A small utility crate to install a uniform tracing subscriber
  • crate-template: Template crate to use when instantiating new crates under crates/.
  • examples: Example usage of the reth stack as a library.