Examples
Use the Coins chain to explore runtime composition, the Bridge chain to follow a certificate flow, or the custom module skeleton to build your own module.
Coins chain
The Coins chain is a proof-of-authority example and a starting point for tracing coin operations and runtime composition. Its package is nunchi-coins-chain; its local node binary is coins-chain-node.
Start it with the local network instructions. Then follow the application type:
| Type | Purpose |
|---|---|
CoinsRuntime | The example's application runtime |
ClobExtension | The CLOB consensus extension connected to that runtime |
nunchi_chain::Application<CoinsRuntime, ClobExtension> | The application type combining runtime and extension |
BasicApplication | The alias without a consensus extension, used for focused tests |
Follow the runtime construction, transaction dispatch, and finalization handling to see how each module participates. The CLOB reference explains where matching ends and application settlement begins.
Coins indexer
The Coins indexer is a separate service that receives and verifies consensus artifacts. Its /consensus/summary/ws stream emits JSON summaries. The kind field distinguishes seed, notarization, and finalization events; use it to identify the stage of consensus represented by each update.
Bridge chain
The Bridge chain example runs two independent chain instances and a relayer. Each chain has its own validator set, DKG threshold output, networking namespace, storage directory, and ports.
Build the example binaries:
cargo build -p nunchi-bridge-chain --bins
Follow the Bridge README to generate two four-validator configurations and start each validator in its own process. Start bridge-relayer after both chains produce finalizations. The binaries bridge-chain-a-node and bridge-chain-b-node each require their own chain's configuration.
| RPC method | Input shown in the example |
|---|---|
bridge.status | Status query |
bridge.latestFinalization | Latest-finalization query |
bridge.finalization | { "height": 1 } |
bridge.submitFinalization | { "finalization": "<hex>" } |
bridge.latestAccepted | Latest-accepted query |
Custom module
The nunchi-custom-module skeleton is a Cargo workspace member. Its module root exposes the following pieces:
| Source area | What to inspect |
|---|---|
transaction | Operations, transaction payloads, and authorization inputs |
ledger | Application of operations and module errors |
db | Typed state access |
genesis | Initial accounts and module state |
events | Output records for value changes |
rpc | The optional RPC surface |
tests | Expected behavior of the skeleton |
Start with the skeleton's operations and tests, then connect its ledger and RPC surface to your application runtime.