Add blob-wanter: standing wants for our own feeds blobs

Nothing in ssb-server fetches blobs mentioned in replicated messages;
that was happening via ssb-blobs sympathy, which is the same mechanism
that let strangers fill the disk. This replaces it with explicit wants
scoped to feeds we actually replicate.

want() has no expiry and the want map is broadcast to every peer on
connect, so a standing want fires whenever a long-offline peer returns.
sbot keeps that map in memory, so this process ties its lifetime to the
connection and re-arms the backfill on every restart.

Verified: removing a referenced blob makes it report
already_have=266 newly_wanted=1 and issue the want.
This commit is contained in:
ops
2026-08-14 17:40:09 +00:00
parent d380db741b
commit a39af4fad3
2 changed files with 227 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# run-blob-wanter.sh
# Same shape as run-server.sh / run-ssb-viewer.sh: keep it alive, and let the
# process exit cleanly when its sbot connection dies.
#
# Restarting on sbot loss is not just tolerated here, it is REQUIRED: sbot's
# want map is in-memory and is wiped on every sbot restart. Coming back up
# re-runs the backfill and re-arms every standing want.
while true; do
NODE_OPTIONS="--dns-result-order=ipv4first --max-old-space-size=128" ./blob-wanter.js
echo "Restarting blob-wanter at $(date)"
sleep 5
done