Network hub listener (hubsync.js), off unless HUB_ENABLED

POST /api/hub/events: signed hub hooks (HUB_SECRET, 5-minute window), each seq applied once, 503 so the hub retries.
member.joined from another door: /v1/resolve the person (climbing to sponsors not here yet) and make waiting accounts
through lsinbound.receive (joinedVia 'hub', joinedRef 'hub:<door>'); existing accounts keep their sponsor and the
difference is listed in /api/admin/hub. wallet.connected fills waiting accounts only; sponsor.changed is a TODO.
Our own new accounts and wallet links go to /v1/join and /v1/wallet from a persisted outbox (hubsync.json), never
in the way of a sign-up. With the flag off nothing is initialised, wired, routed or written; the LinkSpin sync is
unchanged. Test: qa/hubsync.test.cjs against a local network-hub (needs /v1/resolve by id, branch hub-resolve-id).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-12 17:02:45 -06:00
parent 74354346a3
commit 5c896cb782
6 changed files with 465 additions and 6 deletions
+2
View File
@@ -74,6 +74,8 @@ elif [ "$MODE" = "policy" ]; then
node qa/profile-policy.test.cjs || status=1
elif [ "$MODE" = "bixpay" ]; then
node qa/bixpay.test.cjs || status=1
elif [ "$MODE" = "hub" ]; then
node qa/hubsync.test.cjs || status=1 # needs the network-hub checkout beside this repo (HUB_DIR to override)
elif [ "$MODE" = "walletnudge" ]; then
node qa/walletnudge.test.cjs || status=1
elif [ "$MODE" = "tankhold" ]; then