What is kept, and where

Every piece of state in the network, where it lives, who writes it, and what it survives:

  • restart: its process stops and starts, by a crash, a kill or a deploy
  • reboot: the machine goes down and comes back
  • chain restart: the local chain stops and starts
  • new network: new contracts, new addresses, new service ids

On the chain

StateWhereWritten byRestartRebootChain restartNew network
Contracts and their addressesthe chain; offchain/deployments.jsonnpm run deploy, scripts/deploy-network.shyesyesyesdeployed anew; the old manifest is in every snapshot
Operators: identity, own stake, commissionStakingManager, IdentityRegistryeach operator's keyyesyesyesregistered and staked again from the recorded amounts
DelegationsStakingManagereach delegator's keyyesyesyesmade again when this machine holds the delegator's key
Listings and their service idsServiceRegistryeach operator's keyyesyesyeslisted again; every id changes; the map is written
Sessions and their escrowPaymentManagerbuyers and nodesyesyesyesno
Balances: USDC, ZAI, ETHthe tokenseveryoneyesyesyesno
Ratings the chain keeps, disputes, jury stakesReputationRegistry, DisputeManager, the arbitratorthe protocolyesyesyesno
Deposit addresses, smart accountstheir factoriesthe factoriesyesyesyesmade anew by the new factories

A public chain keeps its own state. The local chain keeps it in ~/.aioum-chain/state.json (AIOUM_CHAIN_DIR): anvil --state, saved every 15 seconds (AIOUM_CHAIN_STATE_INTERVAL) and when it stops, loaded at every start. scripts/devstack.sh deploys only onto a chain that does not hold the contracts.

Off the chain

<runner> is a runner's folder: ~/.aioum-private/runner for your own inside your private node, ~/.aioum-shared-runner for the local stack's shared runner, ~/.aioum-reviewers/<n> for its paid reviewers.

StateWhereWritten byRestartRebootChain restartNew network
Agents<runner>/agents.jsona runneryesyesyesids rewritten
Projects and their setups<runner>/projects.jsona runneryesyesyesids rewritten
Runs, the newest 400<runner>/runs.jsona runneryesyesyesids rewritten; open sessions closed in the record
Spend, per hour and service<runner>/spend.jsona runneryesyesyesids rewritten
Bought skills<runner>/skill-cache/a runneryesyesyesmoved with the id
Learned skillson each agent, agents.jsona runneryesyesyesyes
Tool ratings, the runner's copy, the newest 2,000<runner>/experience.jsona runneryesyesyesyes, by their key
Reviews of listings<runner>/reviews.jsona runneryesyesyesids rewritten
The runner's list of listings<runner>/listings.jsona runneryesyesyesthe old list kept under its network's name
Pipelines you createdtheir agents and project, abovea runneryesyesyesids rewritten
A shared runner: the people's sealed spending keys, sign-ins~/.aioum-shared-runner/user-keys.json, sessions.json, keys.secretthe shared runneryesyesyesyes, in a snapshot with secrets
A paid reviewer: its bond's record, the sealed scores' salts, the callers' keys~/.aioum-reviewers/<n>/paid-reviews.jsona reviewer's runneryesyesyesyes, in a snapshot with secrets
Tool ratings, the directory's, 30 days~/.aioum-indexer/experience.jsondirectoryyesyesyesyes, by their key
Price history, settled calls, 7 days~/.aioum-indexer/demand.jsondirectoryyesyesyesset aside; read again from the new chain
Announced nodes~/.aioum-indexer/nodes.jsondirectoryyesyesyesyes
Vouchers and the settle queue~/.aioum-node-multi/multinode.json, ~/.aioum-node/node.json, relay.json; SQLite with AIOUM_STORE=sqlitenodesyesyesyesset aside under the old network's name, never replayed
Transcripts, 7 days<node dir>/<name>-transcripts/nodesyesyesyesset aside
Listings added through the app~/.aioum-node-multi/services.added.jsoncatalogue nodeyesyesyeslisted again
The listing ledger~/.aioum-node-multi/listings.jsoncatalogue nodeyesyesyesboth networks kept
Skills uploaded to the node~/.aioum-node-multi/skills/catalogue nodeyesyesyesyes
Templates and the catalogueoffchain/templates/ in the repository; .devstack/catalogue.json built from it and .env at every startthe repository, catalogue:bootstrapyesyesyesyes
Billing accounts and credits~/.aioum-node/billing.dbbillingyesyesyesyes
Deposits and card payments~/.aioum-deposits/deposits.jsondepositsyesyesyeskept as history
Wallets watched for deposits~/.aioum-deposits/wallets.jsondepositsyesyesyesyes; their deposit address changes
The staking node's requests and reviews~/.aioum-backer/requests.jsonstaking nodeyesyesyesids rewritten
The staking node's poolits delegations, on the chainstaking nodeyesyesyesdelegated again
Private node: token, secrets, sign-ins, wallet~/.aioum-private/ (owner-only files)private nodeyesyesyesyes
Private node: memory, schedule~/.aioum-private/memory.json, jobs.jsonprivate nodeyesyesyesyes
Private node: workspace~/.aioum-private/workspace/private node, agentsyesyesyesyes
Private node: installed models~/.aioum-private/models/; the list in models.jsonprivate nodeyesyesyesyes
Studio: library and cast~/.aioum-private/workspace/video/mc/library/studioyesyesyesyes
Studio: voices and voice cache…/mc/studio/voices/, voice_cache/studioyesyesyesyes
Studio: jobs and films…/mc/studio/jobs/<id>/studio, one worker per jobyesyesyesyes
Keys.env, offchain/.envkeys console, youyesyesyesyes
Operator keystoreOPERATOR_KEYSTORE_FILEyouyesyesyesyes
Jury salts~/.aioum/jury-salts.jsonthe CLIyesyesyesyes; they open votes on the old network only
Notes on the docs.notes/docs-notes.jsonthe appyesyesyesyes
A server deployment's units and env files.deploy/scripts/deploy-network.shyesyesyesyes

Every row is in a snapshot. Secrets are inside only with --with-secrets. Transcripts, media, the workspace and the studio's films are inside with --full. Model weights are never inside.

How a record is written

Every store writes to a temporary file, forces it to the disk and renames it over the target. A reader, and the next boot, see the old file or the new one.

A file that does not parse is moved aside as <file>.unreadable-<time> before the store starts from an empty one. The next write cannot replace it.

Each service names itself as the holder of its folder (agents.pid, multinode.lock). A restore refuses to write under it.

What a rating is kept under

operator|listing|tool: the operator's address, the listing's name from its descriptor, the tool. A service id is a counter on one deployment and changes with every new one.

Every rating also carries the network it was paid on and the id its listing had there. On another network it is pointed at the id the same listing has now. When the listing is not there, the rating is set aside with its key and comes back when the listing does.

A network is one deployment on one chain: <chainId>-<hash of an anchor block and the registry's address>. The anchor is the block the deployment ended in. Block 0 is not used: a local chain makes a new one at every start.

What was lost before

Read from the code and tried on a throwaway chain.

WhenWhat was lost
The local chain stopped: a reboot, a crash, devstack.sh downEverything on it. It ran in memory. The next start deployed again and handed every listing another id.
After thatEvery rating sat on whichever listing got its old id. Every agent, project and bought skill named ids of a chain that was gone.
devstack.sh clean, required after every chain resetThe nodes' folders: vouchers, transcripts, and every listing added through the app.
A crash during a writeHalf a file: listings added through the app, the price history, announced nodes, a bought skill, the private node's schedule and model list.
A file that did not parseAll of it. The store started empty and replaced the file at its next write: agents, runs, projects, deposits, backing requests, vouchers.
A rebootEvery service stayed down until someone started it. The studio and the model server were started by hand.
A new networkEverything that named a service id. No command moved it.

What is still lost

WhenWhatWhy
The local chain is killed or loses powerup to 15 seconds of its transactionsit saves its state on an interval and when it stops
The runner is killed with kill -9up to 250 ms of its writeswrites are gathered for 250 ms before they go to disk
Any stopthe run in flightit reads failed, its project pauses and resumes from that stage
Timeratings older than 30 days in the directory, runs past the newest 400the stores are bounded; spend is kept per hour without a bound
A new networkbalances, escrow in open sessions, delegations from keys this machine does not hold, the chain's own ratings, disputes, jury stakesthey belong to other people or are written by the protocol alone
A chain that was reset before ratings carried a keywhich listing an older record was aboutnothing recorded it; such a record is set aside, not dropped

Next: Deploying your own network — the same system stood up on a chain of your own, from a funded deployer key to a launch checklist.