From c71f02a7c76142cb477069a2f84b8c1dabc2d976 Mon Sep 17 00:00:00 2001 From: randogoth Date: Mon, 8 Jun 2026 15:22:01 +0300 Subject: [PATCH] Fix nip05: correct nostr-rs-relay DB schema author column (BLOB) and content holds full event JSON, not profile JSON. Co-Authored-By: Claude Sonnet 4.6 --- modules/services/nip05.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/services/nip05.nix b/modules/services/nip05.nix index 567ec3b..df40778 100644 --- a/modules/services/nip05.nix +++ b/modules/services/nip05.nix @@ -30,9 +30,9 @@ let try: con = sqlite3.connect(f"file:{DB_PATH}?mode=ro", uri=True) rows = con.execute(""" - SELECT pub_key, content FROM event + SELECT author, content FROM event WHERE kind = 0 AND (hidden IS NULL OR hidden = 0) - GROUP BY pub_key + GROUP BY author HAVING created_at = MAX(created_at) """).fetchall() con.close() @@ -43,9 +43,11 @@ let names = {} relays = {} - for pub_key, content in rows: + for author_blob, event_json in rows: try: - meta = json.loads(content) + event = json.loads(event_json) + pub_key = event.get("pubkey", author_blob.hex()) + meta = json.loads(event.get("content", "{}")) name = meta.get("name", "").strip().lower() if not name: continue