Skip to content

Commit

Permalink
hotfix: broken publisher fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Mar 9, 2024
1 parent 7599ad3 commit 61a4691
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apps/nocapd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/announce/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 7 additions & 7 deletions packages/publisher/src/Publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 2 additions & 0 deletions packages/publisher/src/kinds/Kind30166.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 61a4691

Please sign in to comment.