Files
Shadowbroker/scripts/prime_participant_wormhole.py
T
BigBodyCobain 96182fe66d Add git-deploy and skip-remote-prep options for fleet E2E harness.
Supports third-party participants deployed via compose pull; includes wormhole prime helper for fresh VPS nodes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 12:53:36 -06:00

25 lines
871 B
Python

#!/usr/bin/env python3
"""One-shot wormhole/Tor prime for fleet participant nodes (run inside backend container)."""
import json
from routers.ai_intel import _write_env_value
from services.config import get_settings
from services.tor_hidden_service import tor_service
from services.wormhole_settings import write_wormhole_settings
from services.wormhole_supervisor import connect_wormhole
port = int(get_settings().MESH_ARTI_SOCKS_PORT or 9050)
write_wormhole_settings(
enabled=True,
transport="tor_arti",
socks_proxy=f"socks5h://127.0.0.1:{port}",
socks_dns=True,
anonymous_mode=True,
)
tor = tor_service.start(target_port=8000)
if tor.get("ok"):
_write_env_value("MESH_ARTI_ENABLED", "true")
get_settings.cache_clear()
runtime = connect_wormhole(reason="participant_warmup")
print(json.dumps({"ok": True, "tor": tor, "runtime": runtime}))