Skip to content

Crates & Modules

Dolos is a Cargo workspace. The code is split so that generic data-node abstractions, Cardano-specific ledger logic, storage engines, and API servers each live in their own crate and depend on one another in a single direction. This page maps the crates and shows how the main dolos binary is organized.

Workspace crates

CratePathPurpose
dolos-corecrates/core/Chain-agnostic traits and types: Domain, ChainLogic, WorkUnit, and the StateStore / ArchiveStore / WalStore / IndexStore / MempoolStore storage traits. Knows nothing about Cardano.
dolos-cardanocrates/cardano/The Cardano implementation of the core traits: block processing, ledger state, era rules, epoch transitions, and reward calculations.
dolos-redb3crates/redb3/Storage backend built on redb (embedded, ACID, B+tree). Implements WAL, state, archive, indexes, and mempool.
dolos-fjallcrates/fjall/Storage backend built on fjall (LSM-tree), an alternative for write-heavy state and index stores.
dolos-minibfcrates/minibf/Blockfrost-compatible HTTP API server.
dolos-minikupocrates/minikupo/Kupo-compatible HTTP API for datum/script resolution and pattern matching.
dolos-trpcrates/trp/Transaction Resolver Protocol (Tx3) JSON-RPC server.
dolos-testingcrates/testing/Shared test utilities and fixtures.
xtaskxtask/Developer automation (cargo xtask …): test instances, ground-truth generation, DBSync queries.
dolos (root)src/The binary crate: CLI, sync pipeline, relay, serve orchestration, and the runtime adapters that wire everything together.

The API-server crates and several subsystems are gated behind Cargo features. The default build enables mithril, utils, grpc, minibf, minikupo, and trp, so a standard dolos binary ships with every API surface. dolos-trp is an optional feature-gated dependency rather than a workspace member.

Dependency layering

Dependencies point in one direction — from concrete implementations toward the abstract core. Nothing in dolos-core depends on a storage engine or an API server.

The root binary is the only place that picks concrete backends and API servers and assembles them into a running node.

The dolos binary

The binary lives in src/bin/dolos/ and dispatches a set of top-level subcommands:

CommandWhat it does
initInteractive wizard to generate configuration.
daemonFull node — runs the sync pipeline and all enabled API servers together.
syncSync only — pull blocks from the upstream peer and apply them to the ledger.
serveServe only — expose the APIs over already-synced data.
dataInspect and export stored data (dump state, logs, blocks, WAL; prune; import archive).
evalEvaluate a transaction against current ledger state (phase-1 and phase-2).
doctorDiagnose and repair (WAL integrity, rollback, reset genesis/WAL, catch-up stores).
bootstrapInitialize a node from a Mithril snapshot, a Dolos snapshot, or a relay.

The daemon, sync, and serve commands map directly onto the sync pipeline and serving layer described in the following pages. For how to choose between them operationally, see Operations → Modes; for bootstrap, see the Bootstrap section.

Key dependencies

Dolos leans on a small number of foundational crates:

  • Pallas — Cardano building blocks: CBOR codecs, ledger primitives, the Ouroboros mini-protocols, and phase-2 (Plutus) evaluation.
  • gasket — the staged, concurrent pipeline framework used by the sync loop.
  • redb and fjall — the embedded storage engines behind the two storage backends.
  • tokio — the async runtime shared by the pipeline and every API server.
  • tonic (gRPC), axum (Mini-Blockfrost, Mini-Kupo), and jsonrpsee (TRP) — the serving frameworks.