Three independently deployable Cloudflare Worker "nodes" (plus a shared Durable Object) to represent:
- Federal node
- State node
- Oversight node
Each node exposes the same minimal HTTP API backed by an append-only ledger stored in a Durable Object.
GET /healthGET /v1/nodeGET /v1/node/keyGET /v1/ledger/headGET /v1/ledger/statsGET /v1/ledger/entries?from=1&limit=50GET /v1/ledger/entries/:indexPOST /v1/ledger/append(role-gated)
{
"type": "ewp_ballot_cast",
"payload": {
"example": "data"
}
}Fields tx_id and recorded_at are optional; the node will generate them if missing.
From the repo root:
npx wrangler dev --config workers/votechain-nodes/federal/wrangler.toml
npx wrangler dev --config workers/votechain-nodes/state/wrangler.toml
npx wrangler dev --config workers/votechain-nodes/oversight/wrangler.tomlnpx wrangler deploy --config workers/votechain-nodes/federal/wrangler.toml
npx wrangler deploy --config workers/votechain-nodes/state/wrangler.toml
npx wrangler deploy --config workers/votechain-nodes/oversight/wrangler.tomlIf you are calling these Workers from a browser (e.g., the VoteChain POC Monitor/Trust pages), configure CORS:
CORS_ORIGINS(comma-separated allowlist), orCORS_ORIGIN(single origin)
If neither is set, the Worker responds with Access-Control-Allow-Origin: null (blocked by browsers).
By default, POST /v1/ledger/append requires a write token:
Authorization: Bearer <WRITE_TOKEN>
Set via Wrangler secrets:
npx wrangler secret put WRITE_TOKEN --config workers/votechain-nodes/federal/wrangler.tomlFor local-only experiments, you can disable write auth by setting:
ALLOW_INSECURE_WRITES=true
Do not use this in production.