Commit graph

1 commit

Author SHA1 Message Date
Local Dev
96d22e86bd BNS indexer core, source chain and pipe protocol as shared modules
Design step 1 (TheseusNavigator/DESIGN-bns-indexer-service.md). Theseus's
bns-indexer.js and Ariadne's daemon each had their own index logic, and
Ariadne's warm-started from the operator's pre-resolved list, which has no
owners. Ariadne's Thread is to own indexing for the whole machine, with
Theseus reading from it, so both need the same code and the same results.

- bns-index-core.js: the 0.3.70 indexer logic without the Electron port:
  local copies -> published raw snapshot (dl.silentmode.st, Sia mirror)
  -> electrum delta every 30 s, index rebuilt from the beacon txs with
  owner, TLDs from tlds.bch. Writes two local copies atomically (current
  + previous), emits change/fresh with the names that changed, and can
  pause its network work (Economy) without stopping.
- bns-source-chain.js: how readers get names without depending on the
  indexer: memory -> live indexer over the pipe -> local copies -> public
  snapshots -> public BNS indexer for single names, marked provisional
  and replaced when verified data arrives.
- bns-pipe.js: newline-JSON hello/snapshot/get/subscribe/poll over
  \.\pipe\ariadne-bns[-<SID>]. Node cannot reach the pipe handle, so the
  client trusts a connection only through a helper that checks the server
  process (GetNamedPipeServerProcessId) and then relays that same
  connection. A pipe name can be squatted while the indexer is down;
  a 127.0.0.1 port cannot be checked at all.

Theseus keeps its own bns-indexer.js unchanged until migration step 3.
2026-10-03 16:01:26 +02:00