-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started for Developers
This guide covers everything you need to start contributing to Dugite.
- Rust (stable toolchain, edition 2021) — install via rustup
- Git
- ~8 GB RAM for building and running tests
- Linux or macOS (Windows is untested)
No system-level library dependencies are required. The storage layer is pure Rust. On Linux, the optional io-uring feature can be enabled for async I/O.
git clone git@github.com:michaeljfazio/dugite.git
cd dugite
# Build everything (debug)
cargo build --all-targets
# Build release binary
cargo build --release# Run all tests (nextest — parallel, matches CI)
cargo nextest run --workspace
# Run tests for a single crate
cargo nextest run -p dugite-ledger
# Run a single test by name
cargo nextest run -p dugite-ledger -E 'test(test_name)'
# Run doc tests (nextest doesn't support these yet)
cargo test --docAll code must pass these checks before committing:
# Clippy (zero warnings required)
cargo clippy --all-targets -- -D warnings
# Format check
cargo fmt --all -- --check
# Fix formatting
cargo fmt --allThe project is a 15-crate Cargo workspace under crates/:
| Crate | Purpose |
|---|---|
dugite-primitives |
Core types: hashes, blocks, transactions, addresses, values, protocol parameters (all eras Byron-Conway) |
dugite-crypto |
Ed25519 keys, VRF (ECVRF-ED25519-SHA512-Elligator2), KES (Sum6Kes), text envelope format |
dugite-serialization |
In-house multi-era CBOR encoder/decoder (minicbor-based) |
dugite-uplc |
In-house UPLC CEK machine — 100% conformant; used by dugite-ledger for Phase-2 Plutus evaluation |
dugite-network |
Ouroboros mini-protocols (N2N/N2C), multiplexer, pipelined ChainSync client |
dugite-consensus |
Ouroboros Praos, chain selection, epoch transitions, VRF leader check |
dugite-ledger |
UTxO set (UTxO-HD), transaction validation (Phase-1/Phase-2), ledger state, certificates, rewards, governance |
dugite-mempool |
Thread-safe transaction mempool with input-conflict checking and TTL sweep |
dugite-lsm |
Pure-Rust LSM-tree engine for the on-disk UTxO set; optional io-uring feature on Linux |
dugite-storage |
ChainDB = ImmutableDB (append-only chunk files) + VolatileDB (in-memory HashMap). On-disk UTxO set is backed by dugite-lsm
|
dugite-node |
Main node binary: config, topology, pipelined sync, Mithril import, block forging |
dugite-cli |
cardano-cli compatible CLI (38+ subcommands) |
dugite-monitor |
Terminal monitoring dashboard (ratatui-based, polls Prometheus endpoint) |
dugite-config |
Interactive TUI configuration editor: tree navigation, inline editing, type validation, search/filter, diff view, init/validate/get/set subcommands |
Plus integration test suites under tests/conformance (protocol conformance) and tests/golden (golden tests).
If you are new to the codebase, start with these files to build understanding:
-
CLAUDE.md(repo root) — Architecture overview, build commands, key patterns -
crates/dugite-node/src/main.rs— Entry point, node startup and sync loop -
crates/dugite-ledger/src/lib.rs— Ledger state and block application -
crates/dugite-storage/src/chain_db.rs— ChainDB (ImmutableDB + VolatileDB) -
crates/dugite-network/src/lib.rs— Network protocol multiplexer -
crates/dugite-consensus/src/lib.rs— Consensus engine and epoch transitions -
crates/dugite-primitives/src/lib.rs— Core type definitions
The fastest way to get a running node is to use the preview testnet with Mithril snapshot import:
# Step 1: Build release binary
cargo build --release
# Step 2: Import Mithril snapshot (preview, network-magic=2)
./target/release/dugite-node mithril-import \
--network-magic 2 \
--database-path ./db-preview
# Step 3: Run the node
./target/release/dugite-node run \
--config config/preview/config.json \
--topology config/preview/topology.json \
--database-path ./db-preview \
--socket-path ./node.sock \
--host-addr 0.0.0.0 --port 3001Network magic values: Mainnet=764824073, Preview=2, Preprod=1
Prometheus metrics are available at http://localhost:12798/metrics.
Dugite follows an iterative development approach:
- Assess — Evaluate the current state of the codebase and identify the highest-impact gap or bug to address next
- Implement — Build the next feature or fix, keeping changes focused and reviewable
-
Test — Run
cargo test --alland ensure zero failures before moving on - Verify — Run clippy and fmt checks; all code must be warning-free and formatted
- Commit — Commit with a descriptive message and push to the remote branch
- Repeat — Move on to the next highest-priority item
- Zero compiler warnings (
RUSTFLAGS="-D warnings") - Clippy clean
- All tests passing
- Code formatted
- CI green before merge
| Variable | Default | Description |
|---|---|---|
DUGITE_PIPELINE_DEPTH |
300 | ChainSync pipeline depth |
RUST_LOG |
info |
Log level (trace, debug, info, warn, error) |
- Architecture Decision Records — Key design decisions and rationale
- Protocol Compliance — Current feature compliance status
- Performance Baselines — Measured performance numbers
- Known Issues — Current bugs and limitations
- Published Documentation — mdBook documentation