Commit graph

2 commits

Author SHA1 Message Date
Local Dev
c7c66e1557 Theseus: read BNS names from Ariadne's indexer; its own is the standby
Migration step 3 (DESIGN-bns-indexer-service.md). Ariadne's Thread now owns
BNS indexing on the machine, so Theseus no longer runs a second electrum
indexer beside it.

bns-indexer.js keeps its process and its messages to main.js, but inside
it is now an index host on the shared source chain:
- Ariadne's indexer over its pipe, trusted only after ariadne-helper.exe
  has checked the server process on that connection (found through
  Ariadne's uninstall key), then pushes;
- the local copies: Ariadne's files for both scopes, Theseus's own raw
  copy, the bundled one. The richest wins.
- Theseus's own index copy, written from the pipe data.

The shared core runs as Theseus's own indexer only while Ariadne is
unhealthy. That means: no pipe 4 s after launch, a pipe that fails the
check, a pipe that went silent, or an index not confirmed for 10 min while
Ariadne is not paused. The own indexer warm-starts from Ariadne's
snapshot, so there is no download and no cold sync. It hands back after
90 s of health, so a flapping service does not start and stop it. Economy
is not a failure and never triggers a takeover. With no checkable Ariadne
(portable, not installed, older than the pipe) the own indexer starts at
once, as in 0.3.70. The one thing Theseus does on Ariadne's side is run
the indexer's task at launch when "Launch at start" is off.

main.js passes the shared module paths (packaged as .mjs, which is why the
shared modules no longer import each other) and keeps the host's status.
The Ariadne panel takes its state from the indexer task when one exists,
and the sub-page says where Theseus's names come from.
2026-10-03 17:06:24 +02:00
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