mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-07-12 06:56:37 +02:00
Enable zero-config Infonet fleet join for all participant nodes.
Ship sb-testnet fleet defaults, swarm/join API, NODE launcher registration step, and meshnode script defaults so users discover peers via the signed seed manifest without manual peer lists. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -249,12 +249,41 @@ export async function startTorHiddenService(): Promise<TorHiddenServiceSnapshot>
|
||||
});
|
||||
}
|
||||
|
||||
/** Warm Tor/Arti and (re)enable the participant node so Infonet seed sync can run. */
|
||||
export interface InfonetSwarmJoinSnapshot {
|
||||
ok?: boolean;
|
||||
detail?: string;
|
||||
announce?: {
|
||||
ok?: boolean;
|
||||
peer_url?: string;
|
||||
skipped?: boolean;
|
||||
results?: Array<{ seed_peer_url?: string; ok?: boolean; status_code?: number }>;
|
||||
};
|
||||
manifest_pull?: {
|
||||
ok?: boolean;
|
||||
peer_count?: number;
|
||||
merged_peer_count?: number;
|
||||
seed_peer_url?: string;
|
||||
detail?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** Register with the fleet seed and pull the signed peer manifest. */
|
||||
export async function joinInfonetSwarm(): Promise<InfonetSwarmJoinSnapshot> {
|
||||
const result = await controlPlaneJson<InfonetSwarmJoinSnapshot>('/api/mesh/infonet/swarm/join', {
|
||||
method: 'POST',
|
||||
requireAdminSession: false,
|
||||
});
|
||||
invalidateInfonetNodeStatusCache();
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Warm Tor/Arti, enable the node, and join the private Infonet swarm. */
|
||||
export async function ensureInfonetParticipantNodeReady(): Promise<void> {
|
||||
if (!getNodeIdentity()) {
|
||||
await generateNodeKeys().catch(() => null);
|
||||
}
|
||||
await startTorHiddenService().catch(() => null);
|
||||
await setInfonetNodeEnabled(true);
|
||||
await joinInfonetSwarm().catch(() => null);
|
||||
await fetchInfonetNodeStatusSnapshot(true).catch(() => null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user