The Cardano Rust node is a full proof-of-stake blockchain node engineered around the Ouroboros family of consensus protocols. This workspace brings the ledger, network, storage, tracing, and CLI layers together in idiomatic Rust while maintaining compatibility with the broader Cardano ecosystem.
- ✨ Full multi-crate workspace covering consensus, ledger, networking, storage, tracing, API, node runtime, and testnet utilities.
- 🔁 End-to-end automation with build, test, security, documentation, and release pipelines that mirror production expectations.
- 🧪 Comprehensive testing including unit, doc, property, integration, performance, and nightly mainnet sync coverage.
- 📦 First-class packaging via Docker images, multi-target binaries, and staged crates.io publications.
- 🧱 Modular architecture designed for reuse and community contributions across Cardano services.
| Path | Purpose |
|---|---|
crates/cardano-node |
CLI entrypoint, runtime wiring, dashboards, and administrative commands. |
crates/cardano-consensus |
Ouroboros consensus algorithms and block validation logic. |
crates/cardano-ledger |
Ledger rules, UTxO accounting, certificates, and governance primitives. |
crates/cardano-network |
Multiplexed network stack, handshake negotiation, and peer selection. |
crates/cardano-storage |
Ledger database, LMDB backend, and snapshot handling. |
crates/cardano-crypto |
Cryptographic primitives, VRFs, and signature utilities. |
crates/cardano-tracing |
Structured logging, telemetry sinks, and observability helpers. |
crates/cardano-api |
Client-facing gRPC/REST adapters and wallet bridges. |
crates/cardano-testnet |
Local testnet orchestration helpers and fixtures. |
config/ |
Example configuration and topology files for running preview/test environments. |
scripts/ |
Developer ergonomics: readiness checks, preview connectivity, and release helpers. |
docs/ |
Source for the GitHub Pages developer documentation site (Jekyll). |
tests/ |
Cross-crate integration tests, network scenarios, and regression suites. |
- Rust toolchain
1.80or newer (install viarustup). cargo,rustfmt, andclippycomponents (installed throughrustup component add).- Optional: Docker (for container builds) and Ruby 3.1 with Bundler (for docs site work).
- Clone the repository and enter the workspace:
git clone https://github.com/cardano-rust/cardano-node-rust.gitcd cardano-node-rust
- Ensure the recommended toolchain is active:
rustup toolchain install 1.80 && rustup default 1.80. - Build the full workspace:
cargo build --workspace --all-features.
The CLI exposes several commands (see cardano-node --help). A minimal preview run looks like:
cargo run --release --bin cardano-node -- run \ --config config/test-config.json \ --topology config/test-topology.json \ --database-path ./tmp/db \ --socket-path ./tmp/node.socket
You can validate configuration files before running using cardano-node validate --config path/to/config.json.
cargo fmt --all– format the entire workspace (CI enforces--check).cargo clippy --workspace --all-targets --all-features -- -D warnings– static analysis matching CI.cargo deny check– dependency policy checks (matches CI dependency-check).
cargo test --workspace --all-features– unit and doc tests across every crate.cargo test --doc --workspace– doctests only (mirrors CIdocsjob).- Property tests live under each crate’s
tests/orproptestmodules and can be run withcargo test -p <crate> proptest.
cargo test --test integration mainnet_sync -- --ignored --nocapturecargo test --test integration chain_reorg -- --ignored --nocapturecargo test --test integration snapshot_recovery -- --ignored --nocapturecargo test --test network_integration -- --ignored --nocapture(network handshake flows)
The integration suites are marked ignored to avoid long runtimes; remove --ignored to skip heavy scenarios locally. Use the helper scripts in scripts/ (e.g., verify_readiness.sh, test-preview-connection.sh) for higher-level environment validation.
- Benchmarks:
cargo bench -p cardano-storage(adjust crate as needed). - Coverage:
cargo tarpaulin --workspace --out Html --all-features(mirrors CI coverage job).
The docs/ directory houses the GitHub Pages developer portal. To build locally:
- Install Ruby 3.1 and Bundler.
cd docsbundle installbundle exec jekyll serve --livereload
The Docs workflow automatically builds and deploys the site whenever docs/ changes land on the deployment branch.
Key narrative documents currently live in:
docs/architecture/HASKELL_COMPATIBILITY_GAPS.mddocs/guides/BLOCK_PRODUCTION_RUNTIME_EXAMPLE.md
| Workflow | Trigger | What it verifies |
|---|---|---|
CI (ci.yml) |
PRs, main/develop pushes, weekly cron | Formatting, lint, tests, docs, dependency hygiene, coverage, release builds. |
Integration Tests (integration-tests.yml) |
PRs, main/develop pushes, nightly cron | End-to-end sync, reorg, snapshot, network, and performance scenarios. |
Deploy Jekyll Documentation (docs.yml) |
Docs branch changes, manual | Builds and publishes the GitHub Pages documentation site. |
Release (release.yml) |
Semver tags (v*) |
Creates GitHub Releases, publishes binaries, Docker images, and crates.io packages. |
Security Check (security-check.yml) |
PRs, main pushes | Strict clippy security lints, panic/unwrap scans, cargo-audit, unsafe usage review. |
Security (security.yml) |
Daily cron, main pushes/PRs | Automated cargo-audit, cargo-deny, dependency review, and outdated dependency reports. |
- Bump crate versions and workspace metadata as needed.
- Push a tag following the
vMAJOR.MINOR.PATCHconvention. - The Release workflow will:
- Create a GitHub Release with notes.
- Build and attach binaries for Linux (x86_64/aarch64), Windows, and macOS (x86_64/aarch64).
- Publish Docker images to DockerHub and GHCR.
- Publish all crates to crates.io in dependency order.
scripts/verify_readiness.sh– run a comprehensive workspace health check before opening PRs.scripts/test-preview-connection.sh– exercise preview topology connectivity with mock peers.scripts/build-release.sh– local helper mirroring the release job targets.
We welcome issues and pull requests. Before submitting changes:
- Run the readiness script or at least
cargo fmt,cargo clippy -- -D warnings, andcargo test --workspace. - Update or add documentation whenever behavior or interfaces change.
- Follow the Cardano Rust coding guidelines (idiomatic async Rust, structured tracing, error-first design).
Security-related reports should be sent privately following the guidance in the repository’s security policy (or via the Cardano security disclosure process if no file is present).
Licensed under the Apache License, Version 2.0.