Deploy your first contract
You've run your first compute and spun up a machine. Now put logic inside it. Every endpoint below is a real route on the live surface.
1 — Your machine's key
From spin-up you have your machine's slug and its zeq_ak_… key. Keep the
key as $ZEQ_KEY and your slug handy — everything below runs on your machine, on your audit chain.
2 — Deploy a watchdog from a template
Templates ship ready-made. Deploy the force-threshold alarm — NM19 (F = ma) on every reading —
onto your machine:
curl -sX POST https://zeqsdk.com/api/contracts/templates/force-threshold-alarm/deploy \
-H "Authorization: Bearer $ZEQ_KEY" -H "Content-Type: application/json" \
-d '{"slug":"YOUR_MACHINE"}'
# → { "contract_id": "3d4833a0-…", "version_no": 1, … }
That contract is now four states — idle → watching → alert → cleared — living on the machine's
clock, exactly the anatomy you read.
3 — Fire a transition
Move it off the start state. idle → watching fires KO42 — a protocol stamp: no physics claim,
just a clock-stamped step onto the audit chain:
curl -sX POST https://zeqsdk.com/api/chain/YOUR_MACHINE/contracts/CONTRACT_ID/transition \
-H "Authorization: Bearer $ZEQ_KEY" -H "Content-Type: application/json" \
-d '{"inputs":{}}'
# → transition recorded on your chain
That KO42 stamp's value is the bounded HulyaPulse modulation R(t) = S₀·[1 + α·sin(2π·f_H·t)] at
the tick — computed exactly, uncertainty 0, verdict verified. The transition is now on your chain.
4 — Watch it
Your machine's live observer shows the state and every recorded transition:
https://zeqsdk.com/apps/observer/?slug=YOUR_MACHINE
Read the contract's current state and definition back any time:
curl -s https://zeqsdk.com/api/chain/YOUR_MACHINE/contracts/CONTRACT_ID \
-H "Authorization: Bearer $ZEQ_KEY"
What computes vs what stamps
- KO42-only transitions (
idle → watching,alert → cleared) are protocol stamps — clock bookkeeping, no physics claim, no proof required. - Physics transitions (
watching → alert, firingNM19underinput.mass_kg * input.acceleration_ms2 > input.force_limit_n) run a real solver and carry a ZeqProof. Because they're guarded by a sensor reading, drive those through the owner-gated transition route (or an auto-trigger) rather than a manual fire — see the lifecycle.
Read next
- Anatomy of a contract — the definition you just deployed, part by part.
- The lifecycle — pause, version, roll back, audit, export.
- Channels — put a page in front of this contract.