Files
wikideck/docs/night2/TESTNET.md
T
claudeandClaude Opus 5.5 36cbaccd42 testnet-ops: card identity store, pre-bake script, testnet guide
server/game/identity.ts freezes each card's off-chain identity (P31, categories,
country, dates, coords, outlinks hash) once per tokenId in node:sqlite and never
rewrites it. scripts/night2/prebake-identity.ts reads the canonical chain from one
node and freezes from cached card files only; live facts plug in via an
IdentitySource on the wikimedia client's background lane (#62). Tests make zero
network calls. docs/night2/TESTNET.md: nodes, wallets, login, mining, autodeploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 21:42:23 -05:00

4.6 KiB
Raw Blame History

Night 2 private testnet: how to test (testnet-ops, #63)

Testnet only, LAN only, on poweredge-r350. It is never mainnet and never the live wikideck namespace.

Nodes

node URL game modes (env from Night 1 #22)
node-a http://192.168.1.32:3101 classic, trending
node-b http://192.168.1.32:3102 draft
node-c http://192.168.1.32:3103 classic, draft, trending
  • Autodeploy: the nodes follow night/2026-11-17. A loop on r350 (deploy/night/autodeploy.sh, in a dedicated detached worktree) polls the branch every 3 min.
    • On a new head it rebuilds the image and restarts node-a, then b, then c, each after the previous one passes /healthz.
    • While any match or lobby is live it defers, for up to 15 min.
    • Lobbies are in memory, so a deploy that does go through ends games in progress. After night-lead merges, wait about 5 min, or check that all three nodes report the new head, before you start an end-to-end run.
  • Ledgers persist in the Docker volumes across deploys.

Test wallets

Four disposable wallets: alice, bob, carol and dave.

wallet address cards (confirmed)
alice ff9273368c225698d8ae34430800cfe30b10a1c3d8c21091d42960493db556df see #63
bob 80f17f10ca782efd16783d10d71ce43b2993aadccda36dbd0364dee1921cbc22 see #63
carol f2d908633c4313bd77e86650c13d11ac3e7e656223ebe881cc34ffba3f3e0524 leftovers
dave 02bb97f202e1616ab97b45e8938e384dcbf622a0b44a7f4c1589f44236d3ccef leftovers
  • alice and bob were consolidated to 40 cards each with on-chain NFT transfers from carol and dave, so production deckSize 40 works on the testnet and no lower-deckSize test mode is needed.
  • The encrypted browser backups are in a comment on #63, not in git.
    • Backup password: wikideck-night-testnet. It is public and testnet-only: never reuse it, and never put a real secret next to it.
  • Re-check counts at any time: GET http://192.168.1.32:3101/api/decks/<address>?offset=0&limit=24 (pages of 24, follow next).

Load a wallet in the browser

Use a separate browser profile, or a private window, per player, because a browser holds one wallet per origin.

  1. Open a node URL, then Open wallet.
  2. Recover from a local backup: choose the backup JSON file (save it from the #63 comment as alice.backup.json), and enter the backup password above.
  3. Set a new local encryption password (at least 12 characters, anything testnet-only), then confirm it.
  4. The wallet dialog should show the address above and its confirmed card count.

eom.dev login (Dex)

  • There is no new Dex config tonight. The existing wikideck client already allows the 3101–3103 callbacks.
  • Log in with Log in with eom.dev, then unlock the wallet and press Link wallet … to link it to the account.
  • PvP seats are keyed to the account, and ownership is checked on the server against the account's linked wallets. So for a two-player run you need two eom.dev accounts, one with alice linked and one with bob. Which accounts to use is night-lead's call (see #53/#63). Never use a real person's account without their OK.

Mining on the testnet

  • Mining isn't needed for tests. Only run a miner if night-lead asks for more blocks, or to confirm transfers.
  • deploy/night/testnet.sh mine N [workers] runs the native multi-worker miner in a container named wikideck-night-miner (at most 4 workers on r350).
    • Every template costs Wikipedia requests on the node, so it is paced by MIN_GAP.
    • testnet-ops stops any miner by 01:55 (docker rm -f wikideck-night-miner). The nodes stay up.
  • Difficulty (for mobile mining, #59): at block ~90, an accepted block took between about 2 K and 130 K hashes. That is up to ~8 min at the 4-worker r350 rate of ~250 H/s. One light-mode thread on the emulator is far slower, so expect a long wait per block, with high variance.

Card identity pre-bake (engineer WS E)

  • server/game/identity.ts is a persistent per-token store (node:sqlite). It freezes each card's off-chain identity at first sight and never rewrites it. The identity covers P31 classes, categories, country, dates, coordinates and an outlinks hash.
  • scripts/night2/prebake-identity.ts --node <url> --store <file> [--cards <cached.json> ...] reads the canonical chain from one node and freezes what the cached card files know.
    • It never calls Wikimedia itself.
    • Live facts arrive only through the wikimedia team's client on its background lane (#62), once that client has merged.
    • Cards that are still unknown stay unfrozen and are retried on a later run.