Try it on your computer

Every role a person can hold on the network, deploying an agent with a budget, selling a service, backing an operator with stake, sitting on the jury, runs on your own computer as a local development network: the same contracts and services on a private chain with mock USDC, funded test keys and open minting, so every flow runs without spending anything. Each piece starts one terminal at a time until you see exactly what talks to what.

Two ways in: one command, or each piece by hand.

From scratch, in one command

On a fresh machine you need Foundry (forge + anvil), Node 22 or newer with npm, and git:

curl -L https://foundry.paradigm.xyz | bash && foundryup
git clone git@github.com:oum-dev/aioum.git && cd aioum
cp .env.example .env            # add the keys you have; an empty file is fine
scripts/devstack.sh setup       # builds everything, then boots the whole local network

setup builds the contracts and every package (the off-chain services, the SDK, the CLI, the MCP server, the app), starts a local chain, deploys the contracts with the staked jury installed, and lists every real service the machine allows: the fifty keyless gallery templates, each calling its real upstream, plus every keyed template whose key is in .env and, when Ollama is running, the local models and a local planner. It names what it skipped and the key that would list it. Then the agent runner, your private node, the deposit service, the relay, billing, the app, the landing site and the docs, at the addresses on the welcome page, and a few paid calls so there is something to look at when the app opens. Set DAPP_PORT first to serve the app elsewhere than :3000.

An agent built in that local app behaves as it does on the network: allowed to find tools on its own, it searches the live listings during a run, calls what it finds within its budget, and rates each operator on-chain once the session settles.

Day to day: scripts/devstack.sh update pulls the latest, rebuilds and restarts; status shows what is up; logs <name> follows one service; down stops everything; clean also wipes the local state, which a chain reset needs.

This is a private chain that resets on every boot, with test USDC and funded test keys, so it runs on your own computer, not a server. When the code settles, Deploying your own network takes the same services to a public chain on a small server of your own, with TLS in front, which is the first moment anyone else can open the app or connect a node to your network.

By hand

The manual run takes four terminals (or background processes): Anvil, the node software, the facilitator and the demo, with the off-chain dependencies installed once (cd offchain && npm install). Each step says which.

Step 0 — contracts compile + tests pass

First the contract suite proves itself, the same code the network runs; the test count tells you the toolchain is in order:

cd AIOUM
forge test
# → 226 tests passed across 11 suites (protocol, economics, verifiability, commit-reveal + quorum arbitration, account abstraction + verifying paymaster, delegated slashing, governance, fuzz + invariants)

Step 1 — start the local chain (terminal 1)

Anvil is your private chain. It comes up instantly with funded test accounts, and every other piece talks to it:

anvil
# chainId 31337, RPC http://127.0.0.1:8545, funded test accounts

Step 2 — deploy + wire the protocol

With the chain running, one command puts the whole protocol on it:

cd AIOUM/offchain
npm run deploy

This deploys the 10 contracts (plus the local network's mock ZAI / USDC / Permit2), wires the privileged callers (setRewarder, setDisputeManager, reward assets, etc.), funds the demo operator and client, and writes offchain/deployments.json, the address book every other process reads. Expected tail:

  PaymentManager     0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6
  DisputeManager     0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
Wiring...
Funding operator + client...
Wrote .../offchain/deployments.json

Step 3 — start the node software (terminal 2)

Now the seller arrives. The node software is the runtime an operator runs on the network, and its boot is idempotent, so restart it as often as you like:

cd AIOUM/offchain
npm run node            # listens on :8546

On boot the node, acting as operator account #1, stakes 10,000 ZAI of its own (the account holds it, so the node is live at once), registers an identity, and registers a service (mcp:demo-tools, price 1 USDC/call, accepts USDC). Confirm it is up and listed:

curl -s localhost:8546/health
# {"operator":"0x7099...","serviceId":"1","role":"single","blockNumber":…,"selfStake":"10000000000000000000000","totalStake":"10000000000000000000000","minSelfStake":"100000000000000000000","minNodeStake":"10000000000000000000000","live":true,"staked":true,"ok":true}

Step 4 — start the facilitator (terminal 3)

The facilitator lets an agent open a session without holding gas: it relays the signed authorization, pays the gas itself, and never touches the funds:

cd AIOUM/offchain
npm run facilitator     # listens on :8547
curl -s localhost:8547/health
# {"ok":true,"checks":{"rpc":true,"relayerFunded":true},"blockNumber":…,"relayer":"0x90F7...","relayerBalance":"…","inflight":0,"authRequired":false}   (gas-only relayer = account #3)

Step 5 — run the demo agent (terminal 4)

Finally the buyer. The demo agent opens a prepaid session, makes three paid calls and settles: the whole life of a session in a few seconds:

cd AIOUM/offchain
npm run demo

Expected output (the money flow)

Step 3 — open a gasless 10 USDC session (EIP-3009 via facilitator)
→ sessionId    : 1
Step 4 — three paid `wordcount` tool calls (x402 vouchers)
call #1  cumulative=1.000000 USDC  → 9
call #2  cumulative=2.000000 USDC  → 8
call #3  cumulative=3.000000 USDC  → 9
Step 5 — settle on-chain
Money flow report
  client   1000.000000 → 997.000000 USDC   (-3.000000 USDC)
  operator    0.000000 →   2.550000 USDC   (+2.550000 USDC)
  treasury    0.000000 →   0.150000 USDC   (+0.150000 USDC)
  staking     0.000000 →   0.300000 USDC   (+0.300000 USDC)
Conservation check : 10.000000 (expected 10.000000)
On-chain deltas match split: YES ✓

What just happened

The payment from the welcome page just ran for real, every participant a process you started yourself:

PieceRole in the run
Anvilthe local chain holding all contracts + balances
deployput the protocol on-chain and wired it (acts as the DAO on the local network)
node softwarestaked, listed a service, served 3 metered tool calls, settled on-chain
facilitatorrelayed the gasless openSession (EIP-3009) — paid gas, never touched funds
demo agentopened a prepaid session, signed a voucher per call, triggered settle

The agent prepaid 10 USDC and consumed 3 calls = 3 USDC, split at settlement into 2.55 for the operator, 0.15 for the treasury and 0.30 for the stakers behind the operator; the unused 7 USDC was auto-refunded. Nothing was charged that was not served, and nothing served went unpaid.

Troubleshooting

Most first-run problems are ordering or stale state, each with a one-line fix. deployments.json not found: run npm run deploy (Step 2) first. node returned no services: the node software (Step 3) has not finished its boot transactions; wait for /health to report a serviceId. nonce has already been used: you re-ran deploy against a chain with prior state; restart anvil for a clean nonce sequence, then re-deploy. A port in use: override it with RPC_URL for the chain and AIOUM_NODE_PORT for the node software, then point the demo at the new address with NODE_URL (see offchain/src/config.ts and offchain/src/node/server.ts); the facilitator always listens on 8547. A fresh start: restart anvil, then repeat Steps 2–5.

One-shot (background) variant

Once you have seen the pieces separately, the same run fits in one terminal:

cd AIOUM/offchain
anvil --silent &                         # terminal-free
npm run deploy
npm run node &  npm run facilitator &
sleep 4
npm run demo

The node you just ran sold one built-in tool at one price.

Next: Node quickstart, no code — a selling node from one JSON file and a Docker command, with your API behind it.