Commit Graph
10 Commits
Author SHA1 Message Date
Raven Scott d230fb3360 EXPERIMENTAL: replace KV-scan consensus with Autobase sidecar engine
Cut over domain resolution to an Autobase apply-based sidecar fed by
claim/vote dual-writes from dnsPass. Remove the legacy full-KV scan
getConsensusState path and wire all reads through consensus-view.

- Add consensus-resolver, consensus-events, consensus-apply,
  consensus-autobase, and consensus-view modules
- Dual-append consensus events on claim/vote dnsPassAdd/Remove
- Bootstrap sidecar from existing KV entries; persist
  consensusAutobaseKey in network manifest
- Expose sidecar health via GET /api/consensus/status and metrics
- Add consensus-resolver and consensus-apply unit tests
- Expand RFC 0001 to Implemented; update CONSENSUS.md

Rollback: deploy prior release; KV data unchanged, sidecar rebuilds on
next startup.
2026-05-30 23:49:48 -04:00
Raven Scott b1a02e2e84 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.
2026-05-29 05:34:50 -04:00
Raven Scott 343102d4b5 Update docs 2026-05-28 12:39:38 -04:00
Raven Scott 6ee20a3f68 Migrate plugin channels to protomux-rpc only
Replace dual message-channel + RPC setup with a single registerPluginProtocol
path, unified sdk.channels (register/request/event/broadcast), RPC keepalive
(__p2ns.ping/pong), and core request lifecycle on RPC open. Update
global.profile and example.plugin, admin Plugin RPC stats, docs, and
test:plugin-rpc. Breaking: upgrade all peers together; no legacy adapters.
2026-05-28 11:55:01 -04:00
Raven Scott 8854365add Add core.status RPC, RPC invite diagnostics, and WebSocket stats refresh
- core.status handler and coreStatusRequest; diagnoseInviteIssuesAsync
  clears stale failed-invite flags when peers report canProvideInvite
- Admin invite diagnostics and Core stats UI: per-peer remote state,
  text status marks, recommendations aligned with invite.deliver RPC
- Extract stats-collector; push stats/health/status via subscribe-stats
  WebSocket; HTTP only on first Stats tab load
- Document core.status in PLUGIN_SDK; proxy registers onCoreStatus
2026-05-28 11:35:01 -04:00
Raven Scott 84199270b3 BREAKING: Native p2ns.core RPC — invite.deliver, remove legacy invite channel
Replace RPC-to-string adapters and processCoreRequestMessage (~470 lines) with
typed handlers in core-swarm-handlers.js. Autopass invite wire now uses
invite.deliver RPC only; p2ns.core-invite protomux channel is removed.

- Add core-rpc-contract.js (METHODS, INVITE_STATUS) and core-swarm-handlers.js
  with shared processInviteWire for deliver, relay, and pairing
- core-rpc.js: deliverInviteWire via invite.deliver; invite.request returns
  { status, reason, inviteId }; invite.ack carries optional inviteId
- p2ns.js: register native handlers; slim p2ns.core-request (lifecycle only);
  proactive invite ack tracks inviteId; fix missing invite.queued handler
- proxy-server: channel-manager + shared handlers (no p2ns.core-invite strings)
- Tests: core-swarm-handlers.test.js, core-invite-rpc-integration.js; extend test:core-rpc
- Docs: PLUGIN_SDK RPC table; consensus.removeDomain in longform/RESTAPI/glossary
2026-05-28 11:09:05 -04:00
Raven Scott ea9124c429 BREAKING EXPERIMENTAL: Holepunch-native hard migration (RPC core, shared storage, SDK v2)
BREAKING: All nodes must upgrade together. Legacy p2ns.core-request string
messages are rejected; invite/consensus control plane uses protomux-rpc
(invite.request, invite.ack, invite.relay*, consensus.*). Shared Corestore
namespaces are the default for plugin DBs and drives; USE_SHARED_CORESTORE_NAMESPACES=false
is debug-only. Admin plugin actions with params are validated before run.

EXPERIMENTAL: End-to-end RPC invite path reuses existing handlers via adapters;
invite wire still ships on the invite channel. Multi-peer invite/relay
integration tests are not in CI yet (core-rpc-smoke only).

SDK & channels:
- channel-rpc.js, sdk.channels.rpc (register/request/event)
- core-rpc.js for p2ns.core; action-params + plugin route validation
- sdk.db.getCore/reopen, sdk.state.getPeerChannelSnapshot,
  sdk.metrics.getHolepunchStats (schema v1)

Runtime:
- p2ns.js: RPC-first core invite/consensus; Hyperswarm firewall/reconnect
- channel-manager: required protomux-rpc per peer
- db-shared-namespace-migration; drive-manager shared namespaces
- proxy-server: invite.request RPC for joiners

Plugins: file.drop, global.profile, peer.directory, domain.consensus,
peer.visualize, example.plugin (RPC demo); peer.directory UI polish

Also: CI/smoke scripts, diagnostics hardening, plugin config schema validation,
admin action param modal, docs/RFCS, package-lock + engines.node >= 18
2026-05-28 10:51:19 -04:00
Raven Scott 30153bf958 peer paste updates 2026-05-27 23:08:45 -04:00
Raven Scott db77833402 remove test-scripts 2025-12-17 22:50:41 -05:00
Raven Scott 742e27d3f7 reorg 2025-12-17 20:05:50 -05:00