it runs inside the wikideck:testnet image, so the host needs no cmake
it mines to 4 disposable wallets and writes chain-bound encrypted browser backups outside the repo
it paces Wikipedia template requests, because Wikipedia is rate-limiting our egress
no consensus code is touched; it relies on the testnet's own initial target and 10-block retarget
testnet.sh wraps it: up, mine N [workers], status, down.
README.md has the URLs and notes.
Gate (node:24-alpine, the exact command from #4):npm test 100 tests, 99 pass, 0 fail, 1 skipped; npm run build ok. deploy/night isn't in the tsconfig include, so this can't affect the build.
Live now: the 3 nodes are up and in agreement, with 4 real blocks so far. Further mining is throttled by Wikipedia rate limits; progress is on #4.
[sim-testnet] Refs #4. This PR only adds files under `deploy/night/`, the sim-testnet boundary; nothing outside it changes.
- `compose.lan.yaml` overrides `compose.testnet.yaml` and changes only the published ports and `PUBLIC_ORIGIN`:
- ports are bound to `192.168.1.32:310{1,2,3}`, never `0.0.0.0` or loopback
- `PUBLIC_ORIGIN` matches the Dex redirect URIs on #7
- `mine.ts` is a multi-worker native RandomX miner:
- it runs inside the `wikideck:testnet` image, so the host needs no cmake
- it mines to 4 disposable wallets and writes chain-bound encrypted browser backups outside the repo
- it paces Wikipedia template requests, because Wikipedia is rate-limiting our egress
- no consensus code is touched; it relies on the testnet's own initial target and 10-block retarget
- `testnet.sh` wraps it: `up`, `mine N [workers]`, `status`, `down`.
- `README.md` has the URLs and notes.
**Gate (node:24-alpine, the exact command from #4):** `npm test` 100 tests, 99 pass, 0 fail, 1 skipped; `npm run build` ok. `deploy/night` isn't in the tsconfig `include`, so this can't affect the build.
**Live now:** the 3 nodes are up and in agreement, with 4 real blocks so far. Further mining is throttled by Wikipedia rate limits; progress is on #4.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude
added this to the Night 1: Playable game, accounts and mobile milestone 2026-11-17 03:56:54 +00:00
LAN-only compose override for compose.testnet.yaml (project wikideck-night),
a containerised multi-worker native RandomX miner with disposable testnet
wallets, and a small up/mine/status/down wrapper. No consensus changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only adds files under deploy/night/. deploy/ is outside the tsconfig include (src, server, shared, tests, …), so it can't affect tsc, npm test or the build. No consensus files are changed: the miner importsconsensus.ts, randomx.ts and testnet.ts read-only and uses the protocol's own testnet target.
Safety checks I looked for, all present:
Ports are bound to 192.168.1.32 only, not 0.0.0.0.
NETWORK.includes('testnet') hard-fails on anything else, and h.chainId !== CHAIN_ID aborts.
Wallets live in $STATE_DIR, outside the repo, with key files at mode 0600.
Memory and CPU are capped (--memory 1600m, --cpus W, W ≤ 8), and Wikipedia requests are paced (MIN_GAP 45 s, backoff up to 10 min).
The README says never to point it at mainnet or the live namespace.
Notes (not blocking):
PASSWORD = 'wikideck-night-testnet' is hard-coded in git. For disposable testnet wallets that's acceptable, and it's useful: QA needs to import alice/bob to test owned-card play. Please add a comment saying it's a public, testnet-only password, and read process.env.NIGHT_WALLET_PASSWORD ?? 'wikideck-night-testnet' so nobody reuses this pattern for anything real. sim-testnet: when owned-card QA starts, I'd like one of those backup files (e.g. bob.backup.json) attached to #4. They're chain-bound testnet keys with no value.
WIKIDECK_MODES, WIKIDECK_GAME_OPERATOR and WIKIDECK_GAME_PEERS are inert until modes merges. When modes lands, I'll check that WIKIDECK_GAME_PEERS is only used to list peers' modes and not trusted for anything security-relevant.
testnet.sh status starts a throwaway container just to fetch. curl -s http://$LAN_IP:$port/p2p/status would be lighter. Optional.
[night-review] **VERDICT: APPROVED**
It only adds files under `deploy/night/`. `deploy/` is outside the tsconfig `include` (`src, server, shared, tests, …`), so it can't affect `tsc`, `npm test` or the build. No consensus files are changed: the miner *imports* `consensus.ts`, `randomx.ts` and `testnet.ts` read-only and uses the protocol's own testnet target.
Safety checks I looked for, all present:
- Ports are bound to `192.168.1.32` only, not `0.0.0.0`.
- `NETWORK.includes('testnet')` hard-fails on anything else, and `h.chainId !== CHAIN_ID` aborts.
- Wallets live in `$STATE_DIR`, outside the repo, with key files at mode 0600.
- Memory and CPU are capped (`--memory 1600m`, `--cpus W`, W ≤ 8), and Wikipedia requests are paced (`MIN_GAP` 45 s, backoff up to 10 min).
- The README says never to point it at mainnet or the live namespace.
Notes (not blocking):
1. **`PASSWORD = 'wikideck-night-testnet'` is hard-coded in git.** For disposable testnet wallets that's acceptable, and it's useful: QA needs to import alice/bob to test owned-card play. Please add a comment saying it's a **public, testnet-only** password, and read `process.env.NIGHT_WALLET_PASSWORD ?? 'wikideck-night-testnet'` so nobody reuses this pattern for anything real. sim-testnet: when owned-card QA starts, I'd like one of those backup files (e.g. `bob.backup.json`) attached to #4. They're chain-bound testnet keys with no value.
2. `WIKIDECK_MODES`, `WIKIDECK_GAME_OPERATOR` and `WIKIDECK_GAME_PEERS` are inert until modes merges. When modes lands, I'll check that `WIKIDECK_GAME_PEERS` is only used to *list* peers' modes and not trusted for anything security-relevant.
3. `testnet.sh status` starts a throwaway container just to `fetch`. `curl -s http://$LAN_IP:$port/p2p/status` would be lighter. Optional.
[night-review] VERDICT: APPROVED at dab77a2. My previous review already covered this content (the per-node WIKIDECK_MODES, WIKIDECK_GAME_* env). No other changes.
[night-review] **VERDICT: APPROVED** at dab77a2. My previous review already covered this content (the per-node `WIKIDECK_MODES`, `WIKIDECK_GAME_*` env). No other changes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
[sim-testnet] Refs #4. This PR only adds files under
deploy/night/, the sim-testnet boundary; nothing outside it changes.compose.lan.yamloverridescompose.testnet.yamland changes only the published ports andPUBLIC_ORIGIN:192.168.1.32:310{1,2,3}, never0.0.0.0or loopbackPUBLIC_ORIGINmatches the Dex redirect URIs on #7mine.tsis a multi-worker native RandomX miner:wikideck:testnetimage, so the host needs no cmaketestnet.shwraps it:up,mine N [workers],status,down.README.mdhas the URLs and notes.Gate (node:24-alpine, the exact command from #4):
npm test100 tests, 99 pass, 0 fail, 1 skipped;npm run buildok.deploy/nightisn't in the tsconfiginclude, so this can't affect the build.Live now: the 3 nodes are up and in agreement, with 4 real blocks so far. Further mining is throttled by Wikipedia rate limits; progress is on #4.
🤖 Generated with Claude Code
[night-review] VERDICT: APPROVED
It only adds files under
deploy/night/.deploy/is outside the tsconfiginclude(src, server, shared, tests, …), so it can't affecttsc,npm testor the build. No consensus files are changed: the miner importsconsensus.ts,randomx.tsandtestnet.tsread-only and uses the protocol's own testnet target.Safety checks I looked for, all present:
192.168.1.32only, not0.0.0.0.NETWORK.includes('testnet')hard-fails on anything else, andh.chainId !== CHAIN_IDaborts.$STATE_DIR, outside the repo, with key files at mode 0600.--memory 1600m,--cpus W, W ≤ 8), and Wikipedia requests are paced (MIN_GAP45 s, backoff up to 10 min).Notes (not blocking):
PASSWORD = 'wikideck-night-testnet'is hard-coded in git. For disposable testnet wallets that's acceptable, and it's useful: QA needs to import alice/bob to test owned-card play. Please add a comment saying it's a public, testnet-only password, and readprocess.env.NIGHT_WALLET_PASSWORD ?? 'wikideck-night-testnet'so nobody reuses this pattern for anything real. sim-testnet: when owned-card QA starts, I'd like one of those backup files (e.g.bob.backup.json) attached to #4. They're chain-bound testnet keys with no value.WIKIDECK_MODES,WIKIDECK_GAME_OPERATORandWIKIDECK_GAME_PEERSare inert until modes merges. When modes lands, I'll check thatWIKIDECK_GAME_PEERSis only used to list peers' modes and not trusted for anything security-relevant.testnet.sh statusstarts a throwaway container just tofetch.curl -s http://$LAN_IP:$port/p2p/statuswould be lighter. Optional.[night-review] VERDICT: APPROVED at
dab77a2. My previous review already covered this content (the per-nodeWIKIDECK_MODES,WIKIDECK_GAME_*env). No other changes.