# Polaris — the network that stays up **Polaris is a local SourceLess network you administer, rather than a test you watch.** It starts three node processes on real TCP, keeps them on directories under `.sourceless/polaris/`, publishes a JSON manifest naming every endpoint, and **survives a stop and a start with the chain intact**. It runs no checks and reports no verdict. It sits beside the instruments: an explorer and a dashboard are things you hold *up to* a running node, and until this existed there was no running node to hold them up to unless somebody kept one by hand. **It is not `npm run testnet`.** That harness starts 21 processes, runs forty checks, prints a verdict and destroys everything it made — correct for a test, useless for a network you want to still be there tomorrow. Its data directories are temp directories and its product is the verdict. Everything both of them need — genesis, keys, rotation order, how an agent is spawned and spoken to — lives in one shared module and is imported by both. See [TESTNET.md](TESTNET.md) for the harness. **Every claim on this page is labelled.** `MEASURED` means it was observed by running the thing named, on 2026-09-07. `REASONED` means it is an argument from code that was read. --- ## 1. The five commands ```bash npm run testnet:up # start it. Builds first. npm run testnet:status # what every node holds right now npm run testnet:seed # four funded, domain-proved wallets to administer npm run testnet:smoke # submit a burn, a sale and a wrap and watch them seal npm run testnet:down # stop, keeping the chain ``` `up` takes flags, passed through npm with `--`: | Flag | Default | What | |---|---|---| | `--nodes N` | 3 | how many processes. *"A standing network is not a load test."* | | `--mode development\|production` | `development` | `production` runs the committed Midgard genesis, whose roll is 21 seats | | `--root DIR` | `/.sourceless/polaris` | where the data directories live | | `--fresh` | — | **delete the data root first. This throws the chain away.** | | `--foreground` | — | run the supervisor here instead of detaching it | | `--lifetime-hours H` | 168 | the bound every node stops itself after | `MEASURED`, from `node scripts/polaris.mjs` with no command. `down` takes `--timeout-ms N`. `MEASURED`, on `--mode production`: with fewer processes than Midgard's 21 seats, the chain advances at `rosterSize/processes` slots per block. That is the leader schedule working as designed, not a stall. --- ## 2. Starting it ```bash npm run testnet:up ``` ```text starting 3 node(s) in development mode; supervisor pid 55908 log: \.sourceless\polaris\polaris.log ============================================================================== Polaris — 3 node(s) up, development mode, development genesis, declared roster ============================================================================== chain SourceLess development chain (chain id 31337) realm unregistered — this genesis is in no register genesis hash 8ee28b94b15c1db6cfb7e052d2ade53b5e1a8be5d8698e17a679f4b567a576ea keys harness seeds — sourceless-testnet/producer/N, public and not a custody claim data root \.sourceless\polaris manifest \.sourceless\polaris\polaris.json node1 STR.EC3D99E7C7CD ops http://127.0.0.1:60005 admin (write) http://127.0.0.1:60004 p2p 127.0.0.1:60003 producer zk13str_8c1df54960d4cf7564a7… data \.sourceless\polaris\node1 … slot 3000 ms roster 3 seat(s), all filled — one block per slot lifetime bound 168 h — every node stops itself after this ``` `MEASURED`. Three lines in that banner are not decoration: - **`realm unregistered`** — this genesis is in no register. It is a development chain, and the banner refuses to imply otherwise. - **`keys harness seeds`** — the producer keys derive from published seeds. That is stated as *"public and not a custody claim"* rather than left for you to discover. - **`lifetime bound 168 h`** — every node stops itself after a week. `REASONED`: a network that outlives everyone's memory of starting it is a network nobody knows the provenance of. The launcher does not print its own idea of what happened: it waits for the **supervisor** to write the manifest and prints that, so what you read is what the dashboard will read, and a start that failed prints the failure rather than an optimistic banner. `REASONED`. --- ## 3. The ports are ephemeral. Read the manifest. **Every port changes on every start.** `MEASURED`, the same node1 across four starts of the same network, from the supervisor log: ```text [polaris] node1 STR.A2DCE64C1937 on 127.0.0.1:62791 [polaris] node1 STR.A2DCE64C1937 on 127.0.0.1:62217 [polaris] node1 STR.A2DCE64C1937 on 127.0.0.1:57598 ``` The **node id is stable** — the identity is on disk and survives — and the **port is not**. Never hardcode one. Read `.sourceless/polaris/polaris.json`: ```bash node -e "const m=require('./.sourceless/polaris/polaris.json'); console.log('PEERS=' + m.nodes.map(n=>n.p2p).join(',')); console.log('VALIDATORS=' + m.nodes.map(n=>n.producerAddress).join(',')); console.log('OPS1=' + m.nodes[0].opsUrl)" ``` ```text PEERS=127.0.0.1:60003,127.0.0.1:60006,127.0.0.1:60010 VALIDATORS=zk13str_8c1df54960d4cf7564a7ec541f7ff9e4b1aa2e01_79ae,zk13str_fd8b8c40c473e9851bac1723c3ca2ff4737c28c8_6d86,zk13str_0d575236d32cda1dee6e4ddfb1d86934ae1ea298_8ff5 OPS1=http://127.0.0.1:60005 ``` `MEASURED`. ### What is in the manifest `MEASURED`, from a live `polaris.json`: | Key | What | |---|---| | `state` | `running` / `failed`. Deleted entirely by `down` | | `network` | mode, chain id and name, genesis hash, register pin, **`keyProvenance`**, `validatorSetSource` | | `supervisor` | `pid`, `logPath`, `stopFile`, `lifetimeHours`, `detached` | | `slot` | `slotMs`, `rosterSize`, `filledSeats`, `epochStartMs` | | `records` | `gossiping`, `localOnly`, **`worstCaseSealDelayMs`**, and a note explaining both | | `nodes[]` | per node: `id`, `nodeId`, `pid`, `state`, `dataDir`, `p2p`, `opsUrl`, `adminUrl`, `producerAddress`, `height`, `headHash`, `peers` | Each node publishes **two** HTTP endpoints: `opsUrl` is the read-only operator endpoint, and `adminUrl` is the harness's own write channel. The p2p address is the one to hand to `strblk explorer --peers` or `strblk node --peers`. --- ## 4. Two facts that read as bugs, and are not Both are printed by `up` and by `status`, every time. They are here because an operator who has not read them files the same two non-bugs. ### 4.1 An idle chain does not advance ```text An IDLE network at height 0 does not advance, and that is not a fault. Past genesis, a node with nothing held seals an empty HEARTBEAT block once the head is 60 s old and it leads the slot (src/node/hestia.ts DEFAULT_HEARTBEAT_MS), so the height creeps up about once a minute. `npm run testnet:seed` gives it work. ``` *Corrected 2026-10-29. Polaris printed "an IDLE network does not advance … `produceBlock` returns null rather than minting an empty block" until then. The heartbeat (`heartbeatDue` `src/node/hestia.ts:4690`, shipped 2026-10-11) made the first half false past height 0, and `produceBlock` returns a block; the `null` is the node's turn declining before it is called (the `return null` under `heartbeatDue`, `src/node/hestia.ts:3455`). The measurement below was taken before the heartbeat existed and is kept as the reading it was.* `MEASURED`, on a 3-second slot with nothing to do: ```text 12:25:10Z heights: 8,8,8 12:25:30Z node1 height 8 node2 height 8 node3 height 8 ``` Twenty seconds — nearly seven slots — and the height did not move. `REASONED`: an empty block is a block, and a chain that mints them grows without carrying anything. This chain declines to. The consequence for a watcher: **height standing still is not evidence of a healthy or an unhealthy network.** Use `peers`, `valid` and head agreement from `status`, and give it work if you want movement. ### 4.2 Two record kinds do not gossip, and both are refusals **This section read "most record kinds do not gossip" and printed the block below, until 2026-09-15.** It was true, Kvasir closed it, and the transcript kept saying so — which is the failure this page is elsewhere careful about: a `MEASURED` block is a reading of a tree at an instant, and quoting one forever turns it into a claim. ```text Records that reach every node immediately: tx, allocation, registration, wrap, governance, wnft, domain-burn, domain-relinquish, domain-lapse-burn, wnft-transfer, delegation, oort, occultation, fenrir, key-rotation Records that wait for the submitting node's own slot (worst case 9s here): contract, collateral Both lists are read off `RHEA_CARRIERS`, so they cannot drift from what the node actually does. A record that waits is not lost: it is sealed when that node leads a slot, and one refused at seal time is reported with a reason. The two that wait are refusals rather than gaps -- a contract record is signed over bytecode a relay would have to compile, and a collateral record quorum is chain state, so neither can be authenticated by a node asked to amplify it. ``` `MEASURED`, printed by `status` on the running network, 2026-09-15. **The lists are DERIVED now, and that is the part worth keeping.** Both were hand-written constants in `scripts/e2e/midgard-net.mjs` and both went stale the day Kvasir landed — while the comment beside them diagnosed that exact failure for an earlier pair (*"two counts of the same fact, one of them wrong"*) and a third count was written anyway. They read `RHEA_CARRIERS`, so the transcript above cannot disagree with the node that printed it. *What the block used to say:* `RheaKind` was tx|allocation|registration, with no SLNN topic for the rest, so a burn, a sale or a wrap sat on the node it was given to until that node led a slot. `REASONED`, and checkable: a record kind is flooded if and only if a network protocol carries it **and** a submission path reaches that protocol. The transaction protocol carries transfers; the identity protocol carries allocations and registrations; there is no third flooded record protocol. Everything else goes into a queue on `BlockchainCore` that only **that node's own** block production drains. So a governance ballot, a domain burn, a wNFT sale or a wrap submitted to node2 is invisible to node1 and node3 until node2 leads a slot and seals it. It is not lost, and no peer can see it until a block contains it. **The number is in the manifest** so you can hold a stopwatch to it: ```json "records": { "gossiping": ["tx", "allocation", "registration"], "localOnly": ["governance", "wnft", "wnft-transfer", "domain-burn", "wrap", "contract"], "worstCaseSealDelayMs": 9000 } ``` `MEASURED`, at commit `a78ab19`. See §4.3: that `localOnly` list is one kind short, and the correction is in flight. `worstCaseSealDelayMs` is `rosterSize × slotMs`: a node leads one slot per rotation, so a record arriving the instant its node's slot ends waits a full rotation. 3 seats × 3 s = 9 s here. On the Midgard roll of 21 it is 63 s. On the 1313-seat genesis roll it is 65.65 minutes. The smoke run exercises exactly this, and says so: ```text submitting one domain burn, one domain sale and one wrap through the RPC surface worst case 9s each: none of these three record kinds gossips [ok] domain burn sealed and agreed STR.plbeta burned, 10000000000000000 released, on 3 node(s) [ok] domain sale sealed and agreed STR.plgamma moved to delta for 5000000000000000 minor, lock moved with it [ok] wrap sealed and agreed alpha holds 20000000000000000 minor WSTR ``` `MEASURED`. ### 4.3 Two registries counted these kinds differently `MEASURED`, at commit `a78ab19` — the build every output on this page was taken from — the same fact was published as two different numbers: | Source | Total kinds | Do not gossip | |---|---|---| | Polaris manifest (`records.gossiping` + `records.localOnly`) | **9** | **6** | | Gungnir's record table (`/api/reach`, and the first panel on the dashboard) | **10** | **7** | `REASONED`: the difference was exactly one kind — **`collateral`**, the $TR bridge mint and redemption. Gungnir listed it and Polaris did not. Gungnir's table said why it counted it: the collateral submission path goes straight to `BlockchainCore` exactly as the other six do, and no protocol carries it either, so *"a table that quietly dropped the one kind nobody mentioned would be the same defect in miniature."* On that reasoning Polaris's list was the incomplete one. `MEASURED, 2026-09-07`: **a fix is in the working tree and is not yet committed.** `LOCAL_ONLY_RECORD_KINDS` now names `collateral` alongside the other six, which makes both registries say **7 of 10**. Until that is built and committed, a checkout of `a78ab19` will print `6` and a dashboard on the same chain will print `7`, and neither is lying — they were counting different lists. **If you are reading a `6` and a `7` side by side: trust the Gungnir table**, because it is generated from the same constant the per-kind queue counts are read from, so it cannot drift from what you can actually observe waiting on a node. --- ## 5. Checking on it ```bash npm run testnet:status ``` reprints the manifest and then **asks each node**: ```text live, asked of each node just now: node1 height 8 head 571609dca198ce26… state 01ca2ef64107… peers 2 produced 3 valid true node2 height 8 head 571609dca198ce26… state 01ca2ef64107… peers 2 produced 2 valid true node3 height 8 head 571609dca198ce26… state 01ca2ef64107… peers 2 produced 3 valid true ``` `MEASURED`. Everything above those four lines came from the file; those four lines are a live read over each node's endpoint. What to look at: - **head and state root identical across all three** — that is agreement, and it is the point. - **`valid true`** — that node replayed its own chain and reached the state root it committed to. - **`produced`** is per **process** and resets to 0 on restart. `MEASURED`: after a `down`/`up` cycle all three read `produced 0` at height 8. That is not a lost block. When a node is not there: ```text node1 unreachable — connect ECONNREFUSED 127.0.0.1:55912 ``` `MEASURED`. See §7. --- ## 6. Where the chain lives `MEASURED`, the layout under the data root: ```text .sourceless/polaris/ polaris.json the manifest. Written by the supervisor; DELETED by `down` polaris.log the supervisor's own log — starts, stops, unexpected exits polaris.stop the stop file `down` writes; absent while running node1/ .cerberus.lock who holds this directory, and the endpoint to ask instead identity.json this node's keys, sealed chain/snapshot.json the chain audit/ the node's audit journal node2/ node3/ the same ``` `MEASURED`: a node1 directory on a chain at height 8 is 62 KB. ### It persists across restarts `MEASURED`, a full `down`/`up` cycle on a chain at height 8: ```text before down: node1 height 8 head 571609dca198ce26… state 01ca2ef64107… node2 height 8 head 571609dca198ce26… state 01ca2ef64107… node3 height 8 head 571609dca198ce26… state 01ca2ef64107… $ npm run testnet:down stopping the Polaris network (supervisor pid 55908) stopped cleanly; every node took its own shutdown path the chain is still in …\.sourceless\polaris — `npm run testnet:up` brings it back $ npm run testnet:up starting 3 node(s) in development mode; supervisor pid 28860 node1 STR.EC3D99E7C7CD ← the same node id node2 STR.A04DCA7936A9 node3 STR.D93234D671A5 after up: node1 height 8 head 571609dca198ce26… state 01ca2ef64107… valid true node2 height 8 head 571609dca198ce26… state 01ca2ef64107… valid true node3 height 8 head 571609dca198ce26… state 01ca2ef64107… valid true ``` `MEASURED`. Same height, same head, same state root, same node ids. `REASONED`: snapshots are turned **off** — what survives a stop survives because a block was made durable when it was produced, not because a snapshot interval happened to fire. A snapshot interval would make restart faster and would also mean an untested path decides whether the chain comes back. `down` **deletes the manifest**, so `status` afterwards is honest about there being nothing to ask: ```text no manifest at \.sourceless\polaris\polaris.json — nothing is up ``` `MEASURED`. The chain is still on disk. `--fresh` is the only thing that removes it. ### The keystore passphrase `REASONED`, from the supervisor: each node's keystore is sealed with `polaris-node-N-passphrase-long-enough` unless `SOURCELESS_KEY_PASSPHRASE` is set, and it must be the **same on every start** or the node cannot open the identity it saved and the network gets a new node id every time. It is derived and local because this is a development network whose producer keys are published seeds anyway, *"and pretending otherwise would be a custody claim nothing here supports."* You need this to run `strblk explorer --dir` against a stopped Polaris node. `MEASURED`, both halves, in [XPLORER.md](XPLORER.md) §2. ### Nothing it starts is orphaned `REASONED`: each agent holds a pipe from the supervisor and stops itself on EOF. `MEASURED` previously and recorded in the registry: 0 of 3 agents alive 265 ms after the supervisor was SIGKILLed. --- ## 7. Two defects, both now closed Both were reproduced on the runs this page documents, both were written up here while they were open, and both are now fixed. The before figures are kept, because a fix whose "before" has been deleted is a claim rather than a measurement. ### 7.1 Nodes died on a sibling console control event — FIXED `MEASURED` before, from the supervisor log of a network that had been up for hours: ```text [polaris] running [polaris] node1 exited unexpectedly (code 3221225786, signal null) [polaris] node2 exited unexpectedly (code 3221225786, signal null) [polaris] node3 exited unexpectedly (code 3221225786, signal null) ``` `3221225786` is `0xC000013A` — `STATUS_CONTROL_C_EXIT`. All three nodes were terminated by a **console control event**, not by the supervisor, not by a crash, and not by the lifetime bound. **The mechanism, now reproduced rather than reasoned.** On Windows a console control event is delivered by the operating system to every process attached to that console, and a child spawned the ordinary way inherits its parent's console. `GetConsoleProcessList` for a `polaris up --foreground` network showed the supervisor and all three agents on one console, and one `CTRL_BREAK_EVENT` aimed at an unrelated sibling process on it left all four dead. The A/B that settles it ran two real agents under one parent that survived the event, spawned identically except for the flag: the `detached: false` agent exited **3221225786**, the `detached: true` agent was still running, and the parent held both stdin pipes open the whole time — so neither had been asked to stop. **The fix.** Every Polaris agent is now spawned `detached`: `DETACHED_PROCESS` on Windows, which means attached to no console at all, and `setsid` on POSIX. `MEASURED` after, on a live `testnet:up` network: `AttachConsole` against each of the three node pids fails with `ERROR_INVALID_HANDLE` — they are on no console — and a Ctrl+Break that kills a sibling process on the launching console leaves the supervisor and all three nodes alive with the chain at the same height. **What did NOT change, and must not be thought to have.** The stdin pipe is still the lifeline: the supervisor holds it and never writes to it, and an agent that reads EOF still stops itself — snapshot, close sockets, exit 0. Detaching changes what can *kill* an agent, never what tells it to *stop*. If the supervisor dies, the nodes still stop; they now do it cleanly instead of being killed mid-write. ### 7.2 `up` refused to restart a network whose nodes were dead — FIXED `MEASURED` before, reproduced by killing the three node pids and leaving the supervisor alive: ```bash npm run testnet:up; echo "exit code = $?" ``` ```text A Polaris network is already running (supervisor pid 24484). Manifest: ...\.sourceless\polaris\polaris.json Run `npm run testnet:status` to read it, or `npm run testnet:down` to stop it. exit code = 1 ``` `up` read the manifest and refused if `state === 'running'` **and the supervisor pid was alive**. It did not ask whether any node was — while `status`, in the same file, asked every node over its control socket and printed `unreachable — ` for each. So the state you were most likely to be in after §7.1 was exactly the state `up` would not fix, and its message was false at the moment it was printed. **The fix.** Both commands now ask one question, `nodeReachability`, of the nodes themselves. `status` reports the answer; `up` acts on it. `MEASURED` after, on the identical stale state: ```bash npm run testnet:up; echo "exit code = $?" ``` ```text supervisor pid 24484 is alive and its network is not: node1 unreachable — connect ECONNREFUSED 127.0.0.1:55523 node2 unreachable — connect ECONNREFUSED 127.0.0.1:55528 node3 unreachable — connect ECONNREFUSED 127.0.0.1:52286 0/3 nodes answered. Stopping what is left, then starting again. stopping the Polaris network (supervisor pid 24484) stopped cleanly; every node took its own shutdown path starting 3 node(s) in development mode; supervisor pid 41172 exit code = 0 ``` Same chain, same height, no `down` to remember. It still refuses a network that is genuinely there, and now says why it believes that: ```text A Polaris network is already running (supervisor pid 41172). 3/3 nodes answered on their control sockets just now. ``` ### 7.3 A third one you will meet through a node, not through Polaris `JsonRpcSurface.transaction()` reports `unknown` about a transaction the node accepted seconds ago and is actively announcing. `MEASURED` and fully written up in [GUNGNIR.md §5](GUNGNIR.md#5-transaction-says-unknown-about-this-nodes-own-accepted-write). It affects anything reading a node's RPC, including anything you write against Polaris. --- ## 8. The seeded wallets ```bash npm run testnet:seed ``` ```text alpha STR.plalpha zk13str_c19f1351ca6a697d… 100000000000000000 minor, 10000000000000000 locked, proved true beta STR.plbeta zk13str_962c21cecd3a3b78… 100000000000000000 minor, 10000000000000000 locked, proved true gamma STR.plgamma zk13str_28040579fab8cbee… 100000000000000000 minor, 10000000000000000 locked, proved true delta STR.pldelta zk13str_5ee3e46368090415… 100000000000000000 minor, 0 locked, proved false ``` `MEASURED`. Three proved, one deliberately not: an unproved wallet may **receive** and nothing more, and having one wallet on each side of that rule is what makes the entry requirement visible rather than theoretical. `delta` holds an allocation here, and since the domainless-recipient change it would be equally payable without one — what the allocation buys is the NAME, and it is proving one that buys the right to spend. **`seed` run a second time is not always a no-op, and since 2026-09-11 it says WHY.** `REASONED`, from the code: if all four domains are already proved it reports the wallets it has and does nothing. Run again *after* `smoke` — which burns `beta` and sells `gamma` to `delta` — the four starting wallets cannot be rebuilt on this chain at all, and it now refuses before submitting anything: ```text this chain has a history, and seed cannot rebuild these four wallets on it: STR.plbeta was burned and is cooling for another 2591810s: it cannot be reserved again yet STR.plgamma now belongs to zk13str_5ee3e46368090415…, not to gamma That is the domain rules working, not a fault. `smoke` BURNS STR.plbeta and SELLS STR.plgamma to delta, so running it makes this chain one that seed can no longer set up. Start again from a clean chain: npm run testnet:down npm run testnet:up -- --fresh npm run testnet:seed Nothing was submitted, so the chain is exactly as it was a moment ago. ``` `MEASURED`, and the sequence reproduces every time: `seed` → `smoke` → `seed` = exit 1. **What it used to print, and why that was worse than the refusal.** Three bare timeouts: ```text names reserved timed out waiting for every name to be reserved wallets funded 100000000000000000 minor each domains proved timed out waiting for three domains to be proved ``` Every word of that was true and none of it was actionable. *Timed out* reads as "the network is slow", so the next thing an operator does is wait longer — and waiting is never the fix when a record was REFUSED rather than delayed. Worse, the run half-built the wallets on its way to failing: it funded all four before timing out on the proofs, so the chain was left in a state neither the operator nor the script had asked for. The refusal above submits nothing. The burn cooldown in that message is a real thirty days. `STR.plbeta` is not coming back on this chain, and no amount of waiting inside a `seed` run was ever going to change that. `settles()` also says what it saw when it does time out, for the cases that are genuinely slow: it prints the heights it read and states whether the chain was sealing throughout — because a chain that advanced while the condition never came true was not slow, it refused something. `seed` is not a reset. To get the four starting wallets back, start a fresh chain: `npm run testnet:up -- --fresh`, which deletes the data root. The wallets derive from the seeds `polaris/alpha` … `polaris/delta`, so anything that needs to sign as one of them can rederive the key without a file. `REASONED`, from the seeding code. Those are development seeds on a development chain and are not a custody claim. --- ## See also - **[RUNNING.md](RUNNING.md)** — the walkthrough this network is the middle of - **[XPLORER.md](XPLORER.md)** — pointing an explorer at it, four ways - **[GUNGNIR.md](GUNGNIR.md)** — attaching an operating surface to it - **[TESTNET.md](TESTNET.md)** — the check harness, which is a different thing - **[PROCEDURES.md](PROCEDURES.md)** §1 — when something is wrong - `docs/NAMING.md` — why it is called Polaris and what it is not