Files
p2ns/test-scripts
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
..

Smoke tests

These scripts validate core HTTP surfaces on a running P2NS instance.

Prerequisites

  • P2NS is running locally and serving internal domains.
  • Root certificate is trusted so https://p2ns.admin and https://peer.paste resolve.
  • Node.js 18+.

Scripts

  • npm run test:admin checks p2ns.admin health/status/stats endpoints.
  • 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 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

You can pass a custom base URL:

  • node test-scripts/admin-smoke.js https://p2ns.admin
  • node test-scripts/peer-paste-smoke.js https://peer.paste

You can also override plugin targets with env vars:

  • PEER_DIRECTORY_URL
  • GLOBAL_PROFILE_URL
  • FILE_DROP_URL