Run the documentation sandbox#
The sandbox reuses the product test stack. It creates funded test wallets, a native market, and local provider fixtures. It does not use real user funds. Fixture evidence does not establish genuine-provider or production qualification.
Prerequisites#
Use an authorized checkout with its pinned Node.js, Bun, Rust, and Solana build tools.
Install dependencies with bun install --frozen-lockfile.
Docker Compose and the SBPFv3 build tools must be available.
The normal Surfpool lane needs upstream network access.
Select reviewed immutable images for these variables:
| Variable | Required value |
|---|---|
E2E_SURFPOOL_IMAGE | A compatible Surfpool image with an immutable SHA-256 digest |
E2E_POSTGRES_IMAGE | A compatible PostgreSQL image with an immutable SHA-256 digest |
E2E_REDIS_IMAGE | A compatible Redis image with an immutable SHA-256 digest |
SEESAW_E2E_RUN_ID | A new lowercase run identifier |
SEESAW_E2E_ROOT | An absolute private artifact directory, or the default .e2e-runs |
Use image references in the form repository@sha256:digest.
Do not copy placeholder digest values into a real run.
The wrapper selects E2E_ORACLE_MODE=standin and rejects the experimental offline genesis shim.
It does not enable provider-qualified mode.
Start and obtain tutorial inputs#
Run the following commands from the repository root:
export SEESAW_E2E_RUN_ID=docs-first-trade-001
mkdir -p .e2e-runs
chmod 700 .e2e-runs
node scripts/docs_sandbox.mjs preflight
node scripts/docs_sandbox.mjs start
node scripts/docs_sandbox.mjs inputs .e2e-runs/docs-first-trade-001 /private/tmp/seesaw-tutorial-inputs.json
Set the required image variables before you run the commands.
Use a different run identifier for each new stack.
If you select another artifact root, use its run directory in the inputs command.
Preflight must report every requirement as ready.
Startup builds the program, applies database migrations, creates fixtures, and waits for actual API ingestion.
It must not skip subscriber or readiness checks.
After stack startup succeeds, the wrapper provisions four funded resting orders: one bid and one ask for each outcome.
It reads the book back before it writes fixtures/documentation-liquidity.json.
A provisioning failure makes start fail. Keep its artifacts. Create a fresh run. Do not repeat provisioning against a partially changed book.
The version-2 input file identifies the RPC, actual genesis hash, program, mint, market, taker wallet, token accounts, and private signer-file path.
Its nodeEnvironment object contains the SEESAW_* settings for the Node tutorial.
The signer is the funded taker from the liquidity record. It is not the stack administrator.
The wrapper requires liquidity from the same run, RPC, program, market, and settlement mint.
It uses the manifest's genesis hash, or reads getGenesisHash from the loopback RPC when that field is absent.
It contains no private-key bytes. Keep the file private and outside source control.
The wrapper rejects mismatched run identities, changed source, remote endpoints, and expired fixture markets.
Complete a tutorial#
- Open the web address from the input file.
- Use the fixture wallet through the supported test-wallet driver.
- Follow first trade and exit.
- Compare the observed holdings with the expected transaction effects.
- Record the signed transaction identity before dispatch.
- Reconcile any unknown result before another authorization.
Compile the Node tutorial. Then run its read-only mode with the supplied settings:
node scripts/docs_examples.mjs --build-node
node --input-type=module - /private/tmp/seesaw-tutorial-inputs.json <<'NODE'
import { readFileSync } from 'node:fs';
import { spawnSync } from 'node:child_process';
const inputs = JSON.parse(readFileSync(process.argv[2], 'utf8'));
const result = spawnSync(process.execPath, [
'packages/core/node_modules/.cache/seesaw-examples/12-node-quickstart.js', 'read'
], { env: { ...process.env, ...inputs.nodeEnvironment }, stdio: 'inherit' });
if (result.error) throw result.error;
process.exitCode = result.status ?? 1;
NODE
Follow the Node tutorial to review and approve an action. The supplied order settings select a one-share YES buy at the fixture's YES ask. They do not contain an authorization digest. Examine current state before you approve a transaction.
For a developer procedure, use SDK examples with the input file's deployment values. The example registry states each example's execution level. An unsigned instruction example does not complete a funded trade.
The product harness supplies the wallet and browser drivers for signed test flows:
bun run product-e2e:run web
Use the same run identifier and artifact root. This command requires the built fixture stack and its browser prerequisites. Do not import a fixture private key into a wallet that holds real funds.
Run the disposable four-order drill#
For an automated local fixture check, use a fresh sandbox and the compiled Node tutorial:
node scripts/docs_journey.mjs /private/tmp/seesaw-tutorial-inputs.json --execute-local-fixture
The flag authorizes this controlled drill to submit four one-share orders: buy YES, buy NO, sell YES, and sell NO.
Use only the fresh taker and seeded book from this sandbox.
The drill reviews each order, waits for finalization, and checks exact wallet balances and accumulated fees.
It stores logs and result.json in the run's node-journey directory.
The registered node-quickstart example builds the host and runs both the
four-order drill and the lost-acknowledgement recovery drill. Set
SEESAW_DOCS_NODE_INPUTS to the generated inputs JSON. The registered
15-browser-trading example uses a fresh sandbox and reads its
fixtures/seed.json through SEESAW_DOCS_BROWSER_SEED. Both commands are
selected through the registered-example runner's local mode.
An exclusive started.json marker prevents rerunning the drill after any partial or unknown result.
Keep the journal and reconcile an existing signature. Use a fresh disposable run for a new drill.
This result proves the recorded local fixture journey, not a genuine-provider or production deployment.
Examine the result and stop#
Keep the generated endpoints.json, test report, source identity, and transaction evidence in the private run directory.
Examine the result assertions, the exit code, and the returned signature.
Use this command to stop the owned stack:
node scripts/docs_sandbox.mjs stop
The underlying harness verifies ownership before teardown. If keeper process identity is unknown, investigate it before you force cleanup. Do not remove another run's containers or artifacts.
Recover a failed run#
| Failure | Next action |
|---|---|
| Missing image or tool | Correct the failed preflight requirement. |
| Source changed during startup | Keep the failed artifacts. Restart from a stable checkout with a new run identifier. |
| Market expired | Start a fresh run. Do not change the fixture's recorded timestamps. |
| Ingestion unavailable | Examine stack logs and RPC connectivity. Do not fabricate database rows. |
| Lost transaction response | Recover through the attempt journal. Do not restart the economic action blindly. |
| Missing or mismatched liquidity | Keep the failed run. Start a fresh sandbox. Do not substitute token accounts or replay provisioning. |
| Existing output file | Examine the existing inputs. Select a new output path for a new run. |
The product harness reference (unavailable reference) describes device, provider, and isolation qualification. Those checks remain separate from this fixture tutorial.