What
beacon serves did:nostr documents from Mongo, but the data is still kept fresh by the legacy nostr-beacon indexers (firehose, followshose) running under pm2 on nostr.social. firehose is crash-prone (hundreds of pm2 restarts). To own the full pipeline, run beacon's own clean-room indexer (src/indexer.js — raw WebSocket, no nostr-tools) in production and retire firehose.
Scope
- Deploy
src/indexer.js under pm2 (e.g. beacon-indexer), subscribing to kinds 0/3/10002 across the relay set, latest-wins upsert into beacon / follows / relay_lists.
- Validate it keeps the collections fresh (new profiles/follows show up), then retire
firehose.
Open question: follows schema
The new indexer writes the raw kind-3 event ({ tags: [["p", hex], ...] }). The existing prod follows collection is the derived shape followshose produces: { pubkey, follows: [hex, ...], count, created_at }. The resolver (diddoc.js) already reads both, but writing two shapes into one collection is messy — decide the canonical going-forward shape (and whether the new indexer should emit the derived shape for consistency).
Watch-outs
followshose may also populate the relay-health relays collection (uptime stats) that the new indexer does not produce — confirm before retiring it, or keep that piece.
- The indexer writes to the live prod Mongo (same DB the live resolver reads) — stage carefully.
- Preserve latest-wins dedupe; don't regress already-indexed newer events.
Acceptance
- beacon's indexer runs in prod, keeping
beacon / follows / relay_lists fresh.
firehose retired (and followshose retired or its relay-health role preserved).
- No resolver regression; the chosen
follows schema is documented.
What
beacon serves did:nostr documents from Mongo, but the data is still kept fresh by the legacy nostr-beacon indexers (
firehose,followshose) running under pm2 on nostr.social.firehoseis crash-prone (hundreds of pm2 restarts). To own the full pipeline, run beacon's own clean-room indexer (src/indexer.js— raw WebSocket, no nostr-tools) in production and retirefirehose.Scope
src/indexer.jsunder pm2 (e.g.beacon-indexer), subscribing to kinds 0/3/10002 across the relay set, latest-wins upsert intobeacon/follows/relay_lists.firehose.Open question: follows schema
The new indexer writes the raw kind-3 event (
{ tags: [["p", hex], ...] }). The existing prodfollowscollection is the derived shapefollowshoseproduces:{ pubkey, follows: [hex, ...], count, created_at }. The resolver (diddoc.js) already reads both, but writing two shapes into one collection is messy — decide the canonical going-forward shape (and whether the new indexer should emit the derived shape for consistency).Watch-outs
followshosemay also populate the relay-healthrelayscollection (uptime stats) that the new indexer does not produce — confirm before retiring it, or keep that piece.Acceptance
beacon/follows/relay_listsfresh.firehoseretired (andfollowshoseretired or its relay-health role preserved).followsschema is documented.