Marty, reading the feed on 25 September: "I see the level 1 payout, I see a level 2 payout, but I don't see who purchased something and what they bought." And in the main Crypto Team Build group the same lines carried no product name at all, so nobody knew what they were from. feedgroup.js composes one message from every event of a purchase transaction: the buyer and the package on top, the level payouts under it with their dollar equivalents, then who was passed over and why. It is triggered on AdminPaid, the last event the contract emits for a purchase, which is how the missed-payout notice already knows the whole transaction is indexed. Tier payouts and purchases are no longer posted one line at a time. In payouts mode a purchase that paid no member (root or unsponsored buyer) stays silent, as before. Every post now opens with the InstantAdPay header in the main group as well as the payments topic. Composed against three real transactions from the live index before shipping: three tiers, a double pass-up, and a root purchase. QA member walk: 0 bugs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
InstantAdPay — 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 feedchain.js— contract reader + persistent event indexer (free public RPCs)auth.js— SIWE wallet sign-in (EIP-4361), sessions in the volumeaccounts.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/.
Chatbot knowledge is part of every change
chatbot.js answers members two ways: CANNED regex answers and systemPrompt() for the AI. Any
change that a member could ask about (a new pane, a rule, a price, a limit, a fix they noticed) is not
done until both are updated in the same commit, and KNOWLEDGE_DATE in chatbot.js is bumped. The QA
runner (bash qa/run.sh public) fails when a release note on the live site is newer than that date.