Local stack#
cd protocol
RESET=1 ./dev/up.sh # RESET=1 wipes the local chain and dev state firstStarts solana-test-validator with the built program, builds the web bundle, then runs sdk/dev/server.mjs: a stand-in ZEC mint (8 decimals), the pool, the indexer (8788), the relayer (8787), the keeper and the site on 8080 with a test faucet. It refuses to start against a non-local RPC.
| Variable | Default | Meaning |
|---|---|---|
EPOCH_LEN | 60 | Seconds per epoch |
FUND_PER_EPOCH | 0.5 | ZEC added per epoch so rewards show in a quiet local pool |
PORT | 8080 | Site port |
STATE_DIR | ~/.posl-dev | Dev state |
Devnet#
Once the program is deployed, create the pool once, then run the services:
cd protocol/sdk
NETWORK=devnet RPC=... ADMIN_KEY=admin.json FAUCET_KEY=faucet.json node net/init.mjs
NETWORK=devnet RPC=... POOL=pool.devnet.json RELAYER_KEY=relayer.json \
KEEPER_KEY=keeper.json APP_DOMAIN=app.example.com node net/serve.mjsinit.mjs creates a test ZEC mint and initializes the pool with net/params.devnet.json. serve.mjs creates nothing: no airdrop, no stand-in mint, no budget top-up. With ROOT_DOMAIN=example.com it serves the landing on the root domain, the app on app. and these docs on docs.; without it, the app is at /app.html and the docs at /docs/.
On mainnet init.mjs signs with ADMIN_KEY (a single admin key at launch) or, with ADMIN= and no key, prints the instruction to propose to a multisig. serve.mjs refuses a faucet key and refuses to start until tools/mainnet-check.sh passes.
Tests#
cd protocol/sdk
npm run e2e # real proofs on a local validator
PORT=8999 ./run-e2e.sh test/costs.mjs # cost measurementResults of the last full pass are on Status.
Keeper#
The keeper opens each epoch when its time comes and finalizes past epochs, up to 8 per transaction (FINALIZE_BATCH). Anyone may run one: the instructions are permissionless. Env: RPC, KEEPER_KEY, PRIORITY, PRIORITY_MAX.