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.
33 lines
1.4 KiB
Markdown
33 lines
1.4 KiB
Markdown
# 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`
|