Development Workflow
The practical loop: build, run a cluster, test, and the conventions a PR has to meet.
Prerequisites
Section titled “Prerequisites”-
Linux or macOS.
merodbuilds and runs a development cluster on Linux (x86_64, aarch64) and macOS (Apple silicon); the node’s test suites need Linux, so on a Mac run them in a Linux container or VM. -
Rust pinned by
rust-toolchain.toml(1.98.0, withclippyandrustfmt), and thewasm32-wasip2target apps build for (the toolchain file lists it;rustup target add wasm32-wasip2otherwise). -
System packages:
clang,libclang-dev,make,pkg-config,libssl-dev.
cargo build -p merod -p meroctl # the two binariescargo check --workspace # everythingexport PATH=$PWD/target/debug:$PATH # the binaries just builtmeroctl app build apps/kv-store --out kv_store.wasm # one app's componentcargo test --manifest-path apps/kv-store/Cargo.toml # an app's own tests, on the real engineAn app is a calimero:app component; the node reads its ABI (methods, views,
confirm methods, timers, search fields) from the component’s own calimero:abi
section. A WASM core module (an SDK 0.12 app) is refused.
Run local nodes
Section titled “Run local nodes”The quickest cluster is one process. meroctl local up --local starts merod local (the merod on PATH, here the one just built; without --local the
release’s Docker image) in the background and saves it as the node local,
trusting its mock attestation:
meroctl local up --local --nodes 3 # 3 nodes on 127.0.0.1:2501-2503 (the default is 1), state in ~/.calimero/meroctl/local/meroctl local status # the node URLs, the ops token, the log filemeroctl local down # stop it; the state staysmeroctl local up --local --fresh # start overthen:
meroctl login --dev-passkey ./dev-passkey.json --name devmeroctl instance create --name kv --path kv_store.wasm --alias kvmeroctl call --instance kv set --args '{"key":"a","value":"1"}'The login signs up an account (in no organization: the first instance,
naming none, comes with one of its own); --dev-passkey is accepted only
by a development cluster.
merod local runs every node in one process, with mock attestation and the
development storage key. To exercise separate processes (crashes, restarts,
a frozen node), run each node yourself:
-
Initialize three nodes under a scratch home:
Terminal window export CALIMERO_HOME=$PWD/.nodesP=1=http://127.0.0.1:2601/,2=http://127.0.0.1:2602/,3=http://127.0.0.1:2603/for i in 1 2 3; domerod --node n$i init --dev --node-id $i --listen 127.0.0.1:260$i \--public-url http://127.0.0.1:260$i/ --peers $P --ops-token devtokendonemerod --node n1 config --bootstrap -
Run each in its own terminal:
Terminal window merod --node n1 runmerod --node n2 runmerod --node n3 run -
Point
meroctlat any of them with--allow-mock.
All three share the default --cluster dev, so they derive the same
development storage key. Add --origins for a browser frontend on another
port, and --registry-url to install PACKAGE@VERSION.
RUST_LOG=debug merod --node n1 runRUST_LOG=info,calimero_node=debug,openraft=info merod --node n1 runrun defaults to info,openraft=warn, local to warn,openraft=off, and
every line at that level ships to the operator. Keep account ids out of info!,
and user or app content and text from outside the node (an error’s words: %e,
{e:#}, e.message, a body, a reason) out of info!, warn! and error!:
log a kind, code, id or length instead (calimero_node::log_safe).
scripts/check-no-user-data-at-info.py fails a change that logs them; a line
whose error text is the node’s own goes in scripts/check-no-user-data-at-info.allow
with its reason.
Before a PR
Section titled “Before a PR”Run these locally; they are what the required checks are built from:
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo clippy -p calimero-tee-attestation -p calimero-node --all-targets \ --features calimero-tee-attestation/mock-attestation,calimero-node/outbound-testing -- -D warningsthen the tests for what you changed (Testing has the fixtures they need), for example:
cargo test -p calimero-nodecargo test -p merod -p meroctl./scripts/check-like-ci.py runs every job the required Rust check waits
on, read from .github/workflows/ci-checks.yml (--list shows them,
--only <name> runs some). Always run clippy with -D warnings:
-A warnings allows every lint and can only pass.
Commit and PR conventions
Section titled “Commit and PR conventions”Commit subjects and PR titles follow the commit rule in the coding standards. For pull requests:
- A PR focuses on functionality or style, not both.
- The PR template’s Description, Test plan and Documentation update sections are filled in, and its Trust boundary block where a trust-boundary path is touched.
- A bug fix shows its reproduction and before and after output; the reproducing test stays as the regression test.
- Maintainers squash-and-merge; resolve each review conversation as you address it.
The rest of the Definition of Done is in the root
AGENTS.md.
Style rules
Section titled “Style rules”Imports, module layout, error handling, dead code and trust boundaries are in
CODING_STANDARDS.md.
Where design docs live
Section titled “Where design docs live”| Location | What’s there |
|---|---|
docs/ |
This documentation site (Astro Starlight). |
AGENTS.md (root and per crate) |
Orientation for each part of the tree; crates/node/AGENTS.md is the node’s mental model. |
CODING_STANDARDS.md |
How code in the repository is written. |