From 61a46919da922b392799c4899a804ca954ee7a00 Mon Sep 17 00:00:00 2001 From: sandwich <299465+dskvr@users.noreply.github.com> Date: Sat, 9 Mar 2024 20:01:27 +0000 Subject: [PATCH] hotfix: broken publisher fix --- apps/nocapd/package.json | 4 ++-- packages/announce/package.json | 4 ++-- packages/publisher/package.json | 2 +- packages/publisher/src/Publisher.js | 14 +++++++------- packages/publisher/src/kinds/Kind30166.js | 2 ++ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/nocapd/package.json b/apps/nocapd/package.json index 07a09416..2a1a3f9a 100644 --- a/apps/nocapd/package.json +++ b/apps/nocapd/package.json @@ -6,12 +6,12 @@ "license": "MIT", "dependencies": { "@nostr-fetch/adapter-nostr-tools": "0.14.1", - "@nostrwatch/announce": "^0.0.4", + "@nostrwatch/announce": "^0.0.5", "@nostrwatch/controlflow": "^0.0.2", "@nostrwatch/logger": "^0.0.3", "@nostrwatch/nocap": "^0.1.11", "@nostrwatch/nwcache": "^0.0.2", - "@nostrwatch/publisher": "^0.2.1", + "@nostrwatch/publisher": "^0.2.2", "@nostrwatch/seed": "^0.0.1", "@nostrwatch/utils": "^0.0.1", "chalk": "5.3.0", diff --git a/packages/announce/package.json b/packages/announce/package.json index 645cf621..0906ebb8 100644 --- a/packages/announce/package.json +++ b/packages/announce/package.json @@ -1,6 +1,6 @@ { "name": "@nostrwatch/announce", - "version": "0.0.4", + "version": "0.0.5", "description": "Generates a NIP-66 10166 event, NIP-65 10002 event and NIP-01 0 events for monitors on *every* boot.", "main": "dist/index.js", "type": "module", @@ -17,7 +17,7 @@ "nostr-tools": "^2.3.1" }, "devDependencies": { - "@nostrwatch/publisher": "^0.2.0", + "@nostrwatch/publisher": "^0.2.2", "@types/node": "^20.11.24", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", diff --git a/packages/publisher/package.json b/packages/publisher/package.json index 7e39a659..ca4f2306 100644 --- a/packages/publisher/package.json +++ b/packages/publisher/package.json @@ -1,6 +1,6 @@ { "name": "@nostrwatch/publisher", - "version": "0.2.1", + "version": "0.2.2", "type": "module", "description": "Library for publishing nostr.watch relay status and publisher registration events", "main": "index.js", diff --git a/packages/publisher/src/Publisher.js b/packages/publisher/src/Publisher.js index b2ce9569..1e85574f 100644 --- a/packages/publisher/src/Publisher.js +++ b/packages/publisher/src/Publisher.js @@ -76,16 +76,16 @@ export class Publisher { return unsignedEvents } - signEvent(unsignedEvent){ - unsignedEvent.id = getEventHash(unsignedEvent) - const signedEvent = getSignature(unsignedEvent, process.env.DAEMON_PRIVKEY || "") - console.log('++signedEvent') - console.dir(signedEvent) - const valid = validateEvent(signedEvent) && verifySignature(signedEvent) + signEvent(event){ + event.id = getEventHash(event) + event.sig = getSignature(event, process.env.DAEMON_PRIVKEY || "") + // console.log('++signedEvent') + // console.dir(event) + const valid = validateEvent(event) && verifySignature(event) if(!valid) throw new Error('generateEvent(): event does not validate') // if(signedEvent.tags.filter( tag => tag[0]==='s' && tag[1]==='online' ).length > 0) console.log(signedEvent) - return signedEvent + return event } signEvents(unsignedEvents){ diff --git a/packages/publisher/src/kinds/Kind30166.js b/packages/publisher/src/kinds/Kind30166.js index 4864110e..4ef93e2c 100644 --- a/packages/publisher/src/kinds/Kind30166.js +++ b/packages/publisher/src/kinds/Kind30166.js @@ -66,6 +66,8 @@ export class Kind30166 extends PublisherNocap { if(data?.geo?.data){ tags = [...tags, ...ngeotags(data.geo.data, { iso31662: true, iso3163: true, cityName: true })] } + + return tags } }