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
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/*
|
|
* p2ns.admin smoke validation script
|
|
* Usage:
|
|
* node test-scripts/admin-smoke.js https://p2ns.admin
|
|
*/
|
|
|
|
const target = process.argv[2] || 'https://p2ns.admin';
|
|
|
|
async function fetchJson(path) {
|
|
const response = await fetch(`${target}${path}`);
|
|
if (!response.ok) {
|
|
throw new Error(`${path} failed with status ${response.status}`);
|
|
}
|
|
return response.json();
|
|
}
|
|
|
|
async function run() {
|
|
if (process.env.SKIP_SMOKE_TESTS === '1') {
|
|
console.log('p2ns.admin smoke checks skipped (SKIP_SMOKE_TESTS=1)');
|
|
return;
|
|
}
|
|
|
|
const health = await fetchJson('/api/health');
|
|
const status = await fetchJson('/api/status');
|
|
const stats = await fetchJson('/api/stats');
|
|
|
|
if (!health || typeof health !== 'object') {
|
|
throw new Error('Health endpoint returned invalid payload');
|
|
}
|
|
if (!status || typeof status.connectedPeers !== 'number') {
|
|
throw new Error('Status endpoint missing connectedPeers');
|
|
}
|
|
if (!stats || typeof stats.totalRequests !== 'number') {
|
|
throw new Error('Stats endpoint missing totalRequests');
|
|
}
|
|
|
|
console.log('p2ns.admin smoke checks passed');
|
|
}
|
|
|
|
run().catch((err) => {
|
|
console.error(`p2ns.admin smoke checks failed: ${err.message}`);
|
|
process.exit(1);
|
|
});
|