feat(experimental)!: multi-master one ledger (Option B)

Remove the last layer of soft centralization: a lone `--master` on empty
storage could still implicitly genesis a separate Autopass and split the
network on the same TOPIC_SEED. Genesis is now explicit (`--master
--genesis`); secondary masters pair via invite into the same dnsPass as
joiners, with a shared network manifest, split-brain diagnostics, and
writer-aware quorum.

- Genesis vs secondary master boot paths; auto-adopt manifest on upgrade
- Masters without dnsPass accept invites; masters with pass ignore them
- NETWORK_MANIFEST_FILE, P2NS_GENESIS, MASTER_LOAD_DOMAINS, MASTER_INVITE_ONLY
- core.status networkId; admin diagnostics; docs and multi-master tests

BREAKING: operators must run one genesis per network; additional masters
use `node p2ns.js --master` (not `--genesis`) on empty storage.
This commit is contained in:
Raven Scott
2026-05-29 05:34:50 -04:00
parent 9e931b1f4d
commit b1a02e2e84
19 changed files with 920 additions and 55 deletions
+3 -1
View File
@@ -14,7 +14,9 @@ These scripts validate core HTTP surfaces on a running P2NS instance.
- `npm run test:peer-paste` checks `peer.paste` health/stats/OpenAPI endpoints.
- `npm run test:plugins` checks `peer.directory`, `global.profile`, and `file.drop` API endpoints.
- `npm run test:plugin-rpc` runs `plugin-channel-rpc.test.js` (offline contract tests for protomux-rpc plugin channels; no running node required).
- `npm test` runs admin, peer-paste, and plugins smoke scripts in sequence (does not include `test:plugin-rpc`).
- `npm run test:core-rpc` runs core RPC smoke, `network-manifest.test.js`, `core-swarm-handlers.test.js`, `multi-master.test.js` (simulated genesis + N masters, default 4), and invite integration static checks.
- `npm run test:multi-master` runs only the multi-master simulation (`MULTI_MASTER_COUNT=6 node test-scripts/multi-master.test.js` to scale).
- `npm test` runs admin, peer-paste, and plugins smoke scripts in sequence (does not include `test:plugin-rpc` or `test:core-rpc`).
## Custom target URL