Documentation Developers

Operator & deployment guide

Run the source, preserve its storage, and release the same reviewed project.

Local source setup

Requires Node.js22.13+ and npm. Install from the lockfile, compile contracts and build. Apply all D1 migrations once and in journal order, including the wallet-auth tables. Production origins are gyv.quest, www.gyv.quest and the original Site origin; local wallet authentication is allowed only on loopback. A Sites development identity never authenticates the product. Set the GYV-owned WALLETCONNECT_PROJECT_ID in Sites runtime settings and deploy to enable QR/mobile connections; restrict its Reown origin allowlist to the exact GYV domains. This public identifier is returned by GET /api/config/wallet; no server secret is exposed.

npm ci --cache .sites-runtime/npm-cache
npm run contracts:compile
npm run build
node --import ./scripts/sites-env.mjs ./node_modules/wrangler/bin/wrangler.js d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0000_pretty_klaw.sql
node --import ./scripts/sites-env.mjs ./node_modules/wrangler/bin/wrangler.js d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0001_light_mad_thinker.sql
npm run dev -- --port 4325

Persistent boundaries

D1 stores worlds, runs, action receipts, verified wallet links, hashed sessions, single-use challenges and bounded authentication rate limits. R2 stores immutable packages. Local .wrangler/state is durable development data; hosted DB/BUCKET are separate and do not inherit your local QA content. Sessions and challenges must never be logged or exported in support messages.

Do not drop/reset storage to repair a UI issue. Back up through the operator’s account before destructive changes. /api/health tests D1 availability, while a full package download additionally exercises R2.

Release & rollback

Preserve .openai/hosting.json and its exact Site project ID/DB/BUCKET bindings. Use the Sites source workflow and build helper, push exact source, package that revision and deploy that saved version. Preserve the existing audience. Never include .env values, credentials, private keys or local runtime data.

Rollback by redeploying the last verified saved version for the same Site and storage bindings. Do not reverse/drop already applied D1 migrations. An immutable monetary contract cannot be upgraded by redeploying a frontend.

npm run typecheck
npm test
# With the authorized local app running:
npm run test:http

Recovery responsibilities

Each task action is committed with its revision and receipt; no grading worker needs to remain online between requests. An acquisition deadline does not execute a transaction by itself: someone must call the contract’s expiry refund after the deadline.

Reconcile pending wallet transactions against the chain before resubmission. Financial launch, real approvals/transfers, public access expansion and legal execution are separate operator decisions.

Examples explain the implemented mechanics. Live market status belongs to the individual world. No guaranteed buyer, yield or training improvement.