Determine which relays actually accept writes.
NIP-11 enrichment (no key/writes)
nip11Flags also reads min_pow_difficulty (→ requiresPow) and restricted_writes (→ restrictedWrites); stored on the relay doc. Refine the public filter to exclude pow/restricted.
Ephemeral publish-test (ground truth, opt-in)
With PROBE_PRIVKEY set (a dedicated throwaway key, never identity), the prober signs one ephemeral event (kind 20000 — relayed, not stored) and reads the ["OK", id, accepted, reason]. Records acceptsEvents + publishReason (parsed NIP-01 prefix: pow / auth-required / payment-required / restricted / rate-limited / blocked). Off unless the key is set. Tested only on online tracked relays; folded into the existing connection (one WS).
Changes
nip11Flags: + requiresPow, restrictedWrites.
checkRelay: optional testEvent → publishes on open, captures OK; returns publish:{accepted,reason}.
buildTestEvent, reasonCat; probeRelay records publish result; sweepOnce builds one test event/sweep when cfg.privkey.
proberConfig.privkey from PROBE_PRIVKEY. db public filter excludes pow/restricted.
- tests + .env.example.
Acceptance
- NIP-11 pow/restricted captured;
public excludes them.
- With PROBE_PRIVKEY:
acceptsEvents + reason recorded from a real ephemeral write; off without it.
npm test green.
Determine which relays actually accept writes.
NIP-11 enrichment (no key/writes)
nip11Flagsalso readsmin_pow_difficulty(→requiresPow) andrestricted_writes(→restrictedWrites); stored on the relay doc. Refine thepublicfilter to exclude pow/restricted.Ephemeral publish-test (ground truth, opt-in)
With
PROBE_PRIVKEYset (a dedicated throwaway key, never identity), the prober signs one ephemeral event (kind 20000 — relayed, not stored) and reads the["OK", id, accepted, reason]. RecordsacceptsEvents+publishReason(parsed NIP-01 prefix: pow / auth-required / payment-required / restricted / rate-limited / blocked). Off unless the key is set. Tested only on online tracked relays; folded into the existing connection (one WS).Changes
nip11Flags: + requiresPow, restrictedWrites.checkRelay: optionaltestEvent→ publishes on open, captures OK; returnspublish:{accepted,reason}.buildTestEvent,reasonCat;probeRelayrecords publish result;sweepOncebuilds one test event/sweep whencfg.privkey.proberConfig.privkeyfromPROBE_PRIVKEY. dbpublicfilter excludes pow/restricted.Acceptance
publicexcludes them.acceptsEvents+ reason recorded from a real ephemeral write; off without it.npm testgreen.