martbost 1db7699e25 Hub activity from every signed-in LinkSpin use (Marty 2026-11-16: "LinkSpin never reports activity", DownlineHydra Wake it)
The page-load ping (networksso.page) only fires on a full top-level navigation with Sec-Fetch-Dest: document and a
member session that carries an email. It never fired for a Control Room tab kept open (client-side moves and the
/api/my/ping heartbeat), browsers that send no Sec-Fetch headers, wallet-only sessions, or the owner working in the
admin portal. Live finding: Marty has had no LinkSpin member session since 2026-11-15 20:20 UTC, before the ping
shipped (b2669cf, 21:36 UTC); 16 other members already had linkspin rows.
- networksso.seen(s): the same once-a-day ping for any signed-in request; called from /api/me (email or wallet),
  the dashboard heartbeat /api/my/ping and the admin portal page (/admin, the owner's email; hub activity only,
  the admin session is never shared).
- qa/networksso-activity.test.mjs (13 checks, real hub, in run.sh sso + member): a signed-in page load records
  site linkspin, once a day, never API/assets/bots/fetches/signed-out, seen() for an open tab and a wallet session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 07:28:12 -06:00

LinkSpin — site

Membership advertising with immutable on-chain settlement. Zero-dependency Node server (RM Circle pattern): static pages + JSON API + SSE ledger.

Architecture

  • server.js — http server: pages, /api/*, /join/<id> sponsor links, SSE feed
  • chain.js — contract reader + persistent event indexer (free public RPCs)
  • auth.js — SIWE wallet sign-in (EIP-4361), sessions in the volume
  • accounts.js — site-side records only (free members, last-touch sponsor attribution, handles). The CHAIN is the source of truth for money/credits.
  • public/ — landing, live ledger, member area; no client libraries

Chain flip (rehearsal → mainnet)

Everything chain-specific lives in data/config.json (volume): {contract, chainId, chainName, explorer, rpcs, deployBlock}. Defaults point at the Amoy rehearsal deployment. Launch = deploy the mainnet contract, wipe accounts.json/sessions.json/chain-index.json, PATCH /api/admin/chain with the mainnet values, set rehearsal:false via /api/admin/site. Same code, different config.

Run

PORT=3100 node server.js       # DATA_DIR defaults to ./data

Admin API auth: Authorization: Bearer $ADMIN_PASSWORD.

Spec: ../CONTRACT-SPEC.md (v1.0.3-frozen). Contracts: ../contracts/.

S
Description
LinkSpin: the network rotator (test area)
Readme 44 MiB
Languages
JavaScript 81.3%
HTML 13.9%
CSS 3.8%
Python 0.7%
Shell 0.3%