Skip to content

Crate guide

A reference table of the workspace crates, grouped by layer, so you can find the crate you need and know who it serves before you open src/lib.rs. This complements the architecture orientation, which explains the actor model and the dependency layering these crates fit into. For the model the code implements, see the Protocol Reference.

The Audience column is a hint, not a hard boundary: app-dev crates surface to people building apps, operator crates to people running nodes, and internal crates are workspace plumbing you touch when changing the core.

What an application author compiles against, plus the host/guest boundary.

CrateAudienceWhat it isKey facts
sdk (+ sdk/macros)app-devProc-macro SDK for building CRDT apps: #[app::state], #[app::logic], #[app::event], #[app::migrate].Compiles to WASM. Event handlers may run in parallel — handlers must be commutative, idempotent, and pure. Ships the TestHost unit-test harness.
preludeinternalCommon re-exports for ergonomic imports across crates.Convenience surface; no logic of its own.
wasm-abiinternalThe WASM ABI shared between host and guest.Holds schema, embed, normalize, validate, and downgrade of the app ABI.
sysinternalLow-level system / host ABI bindings at the SDK–runtime boundary.Thin type definitions; the contract the runtime’s host functions implement.

The deterministic engine: shared types, execution, and the unified causal log.

CrateAudienceWhat it isKey facts
primitivesinternalCore shared types used across the workspace.ContextId, identities, blobs, CRDT, events, hashes. The layer everything converges on.
cryptointernalCryptographic primitives: keys, signing, hashing, shared-key derivation.Underpins identity and delta signing.
runtimeinternalWasmer + Cranelift WASM execution engine.Builds a VMLogic per call, runs the exported method, returns an Outcome (return value, logs, events, storage delta). 50+ host functions.
daginternalPure causal DAG for delta tracking with automatic dependency resolution.No network or storage deps. Orders changes correctly even when messages arrive out of order.
opinternalThe one Op envelope for the unified causal log.A data write, writer-set rotation, membership change, or policy change are all the same Op. Defines canonical id and scope_root hashing.
projectioninternalScopeState — the single deterministic projection of a scope’s op-log.Same ops, any order, deduped by id, yield the same state and root. acl_view_at resolves the causal-honor authorization view.
authzinternalThe one authorization fold over the op-log.authorize is a single match over the op payload against an AclView resolved at the op’s causal cut — the forward-only / causal-honor property.
op-adapterinternalTransitional bridge mapping per-plane operation types onto the unified OpPayload.Explicitly transitional — slated for deletion once everything runs on the unified payload. Treat its boundaries as moving.

Local (no-chain) group governance.

CrateAudienceWhat it isKey facts
governance-typesinternalSigned group-operation types for local governance (no chain).A leaf crate, so governance-store can depend on the op types without pulling in actix.
governance-storeinternalApply pipeline, broadcast / ack flow, metrics, and notifications for local group governance.Extracted from calimero-context; callers still reach it via re-export shims in that crate.

The running node: orchestration, contexts, transport, and config.

CrateAudienceWhat it isKey facts
node (+ node/primitives)internalNode runtime coordinating sync, storage, networking, and events.Hosts the NodeManager actor, the SyncManager task, and the GarbageCollector. Owns delta handling and blob caching.
context (+ context/primitives)internalThe ContextManager actor: contexts, groups, and per-namespace governance DAGs.30+ message handlers covering execution, governance, membership, and upgrades.
network (+ network/primitives)internalThe NetworkManager actor wrapping the composed libp2p behaviour stack.gossipsub, Kademlia, mDNS, relay, rendezvous, hole-punching, streams. Moves opaque bytes only — never imports app types.
configoperator / internalNode configuration (config.toml) types and loading.Includes the libp2p network identity config.

Persistence: the CRDT collections down to the key-value backend.

CrateAudienceWhat it isKey facts
storageapp-dev / internalCRDT storage collections and the interface over the underlying store.UnorderedMap / UnorderedSet / Counter / registers; the per-entity merge that drives convergence. Ships the converge property-test harness.
storage-macrosapp-dev / internalDerive macros that wire app state into the storage subtree.Derives AtomicUnit and friends so #[app::state] structs become storage entities.
storeinternalColumn-family key-value abstraction over RocksDB via the Database trait.Typed keys with compile-time size / column guarantees. Sibling crates add the RocksDB impl, blob store, and at-rest encryption.

External surfaces, auth, attestation, and the binaries.

CrateAudienceWhat it isKey facts
server (+ server/primitives)operator / internalSingle Axum HTTP server mounting all public surfaces.Admin REST, JSON-RPC 2.0, WebSocket, SSE, Prometheus metrics, embedded dashboard SPA. Holds no business logic — delegates to clients.
auth (mero-auth)operatorForward-auth service: JWT issue / verify, pluggable providers, wallet challenge auth.Runs embedded in the server or behind a reverse proxy. NEAR / Ethereum / custom providers.
clientapp-devTrait-based client library for talking to Calimero APIs.Abstract interfaces for auth, token storage, and API comms; used by tooling and integrations.
meroctloperator / app-devThe operator / developer CLI.Drives nodes: install contexts, call methods, inspect state.
merodoperatorThe node daemon binary.merod --node <name> init then run. Supports --no-default-features for a local-only init build.
tee-attestationoperator / internalPlatform-agnostic TEE attestation generation and verification.Generates / verifies TDX quotes (Linux with TDX); mock attestation on other platforms for development.

Shared plumbing for build scripts and runtime glue.

CrateAudienceWhat it isKey facts
build-utilsinternalShared build-script utilities for Calimero binaries and crates.Workspace version reading and git metadata, so build scripts stay DRY.
utils (utils/actix)internalActix helper utilities reused across the actor crates.Small glue layer for the actor-model code.