Skip to content

feat(nip66): publish kind 30166 and 10166 relay health events #696

Description

@Ferryx349

Summary

After each probe run, publish NIP-66 relay discovery (kind 30166) and monitor announcement (kind 10166) events signed by the monitor identity.
Part of #667.

Problem

Nostream does not publish NIP-66 events. Clients like NDK cannot use this relay's own liveness data to filter dead relays.

Goal

  • Build kind 30166 event from latest probe snapshot (DNS, TLS, RTT, NIP-11 data per NIP-66 spec)
  • Build kind 10166 monitor announcement event
  • Bootstrap monitor identity on first run (NIP-66 SHOULD):
    • kind 0 profile
    • kind 10002 relay list (NIP-65)
  • Monitor signing key from settings (nip66.monitorPrivateKey or env), never expose in admin API
  • Store events via existing NIP-33 parameterized replaceable path (30166 is in 30000–39999 range)
  • Hook into RelayMonitorWorker post-probe callback
  • Unit tests for event shape, tag/content structure, signing
  • Integration test: probe → publish → query via Nostr filter {"kinds":[30166],"authors":["<monitor-pubkey>"]}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions