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
+6
View File
@@ -116,7 +116,13 @@ TOPIC_SEED=p2ns-dns
# Master Node Configuration
# ============================================================================
# Master mode: pass --master on the command line OR set P2NS_MASTER=true (for Docker/PM2).
# Genesis (create network): --master --genesis OR P2NS_GENESIS=true (once per network).
# Secondary masters: --master only (empty storage pairs via invite; do not use --genesis).
# P2NS_MASTER=true
# P2NS_GENESIS=true
# NETWORK_MANIFEST_FILE=cache/network.json
# MASTER_LOAD_DOMAINS=false
# MASTER_INVITE_ONLY=false
# These settings only apply in master mode
# Base interval in seconds for reconnection attempts when peers disconnect (default: 5)
# Master nodes will attempt to reconnect to disconnected peers with exponential backoff