Chronyx docs

Wrap any command, pay only for the seconds it ran, and get back a receipt signed by the node that ran it.

Quickstart

Needs Node 18.17 or newer. The package has no dependencies.

# run once without installing
npx chronyx-cli run -- echo hello

# or install the command
npm install -g chronyx-cli

Without --cloud the command runs on your own machine. Seconds are metered and the receipt is signed for real, but no money moves (settlement: simulated). Use it to see how billing works before you fund anything.

$ chronyx run --budget 2.00 -- python scraper.py
✓ session opened   0x7f3a…c21e
⧗ metered   412s  ████████████  0.1648 USDG
✓ receipt signed   ~/.chronyx/receipts/0x7f3a….json
✓ settled 0.1648 USDG · refund 1.8352 USDG (simulated)

Run in the cloud

Your account is the ed25519 key the CLI creates at ~/.chronyx/node.key. There is no sign-up and no API key: every request is signed with that key.

# --cloud sends the command to the Chronyx node
chronyx account --cloud  # your account id and balance
chronyx run --cloud --worker python --budget 0.05 -- python -c "print(6*7)"

# or set it once for every command
export CHRONYX_CLOUD=https://chronyxrh.com
  • Opening a session holds the budget from your balance. Stopping it pays for the seconds the sandbox was up and returns the rest.
  • When the budget runs out the sandbox is destroyed.
  • Workers: shell (Alpine 3.20), python (3.12), node (22).
  • To run several commands, wrap them in one shell: chronyx run --worker shell -- sh -c 'cmd1; cmd2'.

Fund your account

Balances are paid in USDG on Robinhood Chain through the ChronarkVault contract. The node credits your account after 3 confirmations.

In the browser

Run chronyx account to get your account id, then open chronyxrh.com/fund. Connect a wallet, approve USDG and deposit. The CLI also prints a link with your account already filled in.

From a wallet or script

Approve the vault for the amount, then call deposit(bytes20 account, uint256 amount). USDG has 6 decimals, so 1 USDG is 1000000.

ItemValue
ChainRobinhood Chain (4663)
Vault0x5649715C2B4084f3fA9528fC03143E53EACd14C7
TokenUSDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168

Deposits pay for compute on this node. They cannot be withdrawn back to the depositor. Unused session budget always returns to your balance.

Sandbox limits

Each session gets its own container under gVisor, a user-space kernel that keeps your code away from the host.

0.0004 USDGper second, per started second
2 USDGlargest budget per session
1 sessionopen at a time per account
256 MB · 0.5 CPUmemory and compute
No networkread-only root, writable /work
2 minutesidle sandboxes are closed

Commands

CommandWhat it does
chronyx run -- <cmd>Runs the command, meters it by the second, stops it when the budget runs out, signs a receipt. Takes --budget, --worker, --cloud.
chronyx accountYour account id. With a node: balance, deposits and recent sessions.
chronyx quote <seconds>What that many seconds cost.
chronyx receiptsEvery receipt on this machine, newest first. Add --json for scripts.
chronyx verify <file>Checks a receipt's signature. Any edit to any field breaks it.
chronyx whoamiYour key's id and public key.

run exits with the command's own exit code, or 124 when the budget ran out.

Receipts

Every session ends in a JSON receipt saved under ~/.chronyx/receipts/.

{
  "session": "0x7f3a…c21e",
  "worker": "python",
  "seconds": 412,
  "paid": "0.164800 USDG",
  "refund": "1.835200 USDG",
  "status": "completed",
  "settlement": "ledger",
  "output": "sha256:91c7…",
  "node": { "id": "0xbf86…c85d", "pub": "MCow…" },
  "sig": "5d0a…"
}
  • output is the sha256 of everything the command wrote to stdout and stderr, in order.
  • sig is an ed25519 signature over the canonical JSON of every other field.
  • node.id is derived from the node's public key, so a receipt cannot swap in another key.

SDK

import chronyx from "chronyx-cli";

const session = await chronyx.open({ worker: "python", seconds: 600, cloud: "https://chronyxrh.com" });
const out = await session.exec("python main.py");   // { code, stdout, stderr }
const receipt = await session.stop();

chronyx.verifyReceipt(receipt);                    // { ok: true }

open takes budget or seconds, plus an onTick callback. Leave out cloud to run locally.

HTTP API

Base URL https://chronyxrh.com. The CLI and SDK sign requests for you.

EndpointReturns
GET /v1/nodeNode id, rate, workers, deposit details. Public.
GET /v1/accountBalance, held funds, deposits, recent sessions.
POST /v1/sessionsOpens a sandbox and holds the budget. Body {worker, budget}.
POST /v1/sessions/:id/execRuns {cmd}, output streamed as NDJSON.
POST /v1/sessions/:id/stopCloses, settles, returns the signed receipt.
GET /v1/receipts/:idA closed session's receipt. Public.

Signed requests carry x-chronark-key, x-chronark-ts, x-chronark-nonce and x-chronark-sig, an ed25519 signature over METHOD\nPATH\nTS\nNONCE\nsha256(body). Requests older than 60 seconds or with a reused nonce are refused.