Event JSON
{
"id": "acd118cfaf0404ad47b4777a21ce8dfd5ad963beb477c42f22109ceacaeaf766",
"pubkey": "ee9d979e7e1418a9f7472baf82dc96082a0d4251b77bcb170a6ecec93fadff64",
"created_at": 1729964217,
"kind": 1,
"tags": [
[
"e",
"70c9519bbacae63453cfa6fb3d702ae51fe0e43c40d7fac90ec64bdc670c5f2d",
"",
"root"
],
[
"e",
"37da9a0bbd4c8f5769ea5e8de17d7e372105073d73d05367b26571d3b5dbccc0",
"",
"reply"
],
[
"p",
"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
],
[
"p",
"e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb",
"",
"mention"
],
[
"p",
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
],
[
"p",
"ee9d979e7e1418a9f7472baf82dc96082a0d4251b77bcb170a6ecec93fadff64"
],
[
"p",
"7bbe9e6e5d2c5ec10ab2bdcacc6971710fd2797741f6b283015fc34fe409df44",
"",
"mention"
],
[
"r",
"https://github.com/bitvora/haven/blob/b51529221e3df04de22b73840e2b3cc3ed6b898c/main.go#L247"
],
[
"r",
"Relay.connect"
],
[
"r",
"192.168.1.1:4869"
],
[
"r",
"console.log"
],
[
"r",
"nip19.decode"
],
[
"r",
"Math.floor"
],
[
"r",
"Date.now"
],
[
"r",
"relay.subscribe"
],
[
"r",
"console.log"
],
[
"r",
"eventTemplate.tags.push"
],
[
"r",
"event.id"
],
[
"r",
"console.log"
],
[
"r",
"console.log"
],
[
"r",
"relay.publish"
],
[
"r",
"relay.close"
]
],
"content": "Until greenart7c3 can work his magic, here's another one of my awful scripts to delete all kind 10002 events from a relay, following nostr:nprofile1qqs8h057dewjchkpp2etmjkvd9chzr7j09m5ra4jsvq4ls60usya73qpz4mhxue69uhkummnw3ezummcw3ezuer9wchsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qy88wumn8ghj7mn0wvhxcmmv9ue77sja's advice above. It works with Citrine but not with Haven (Haven is silently ignoring delete events).\n\nnostr:nprofile1qqsw9n8heusyq0el9f99tveg7r0rhcu9tznatuekxt764m78ymqu36cpz4mhxue69uhhyetvv9ujuat50phjummwv5hszymhwden5te0wahhgtn4w3ux7tn0dejj7qg4waehxw309an8yetwwvh82arcduhx7mn99uuwx66a, is supporting NIP-09 (Event deletion requests) something you feel strongly against, or is this just something that haven't been implemented yet / possible bug?\n\nMy impression from this line is that delete events should be working: https://github.com/bitvora/haven/blob/b51529221e3df04de22b73840e2b3cc3ed6b898c/main.go#L247\n\n```javascript\nimport WebSocket from 'ws'\nimport { Relay, useWebSocketImplementation } from 'nostr-tools/relay'\nimport { finalizeEvent, getPublicKey } from 'nostr-tools/pure'\nimport * as nip19 from 'nostr-tools/nip19'\n\n\nuseWebSocketImplementation(WebSocket);\n\nconst relay = await Relay.connect('ws://192.168.1.1:4869');\nconsole.log(`connected to ${relay.url}`)\n\nconst sk = nip19.decode('nsec1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').data\nconst pk = getPublicKey(sk)\n\nlet eventCount = 0\n\nlet eventTemplate = {\n kind: 5,\n created_at: Math.floor(Date.now() / 1000),\n tags: [],\n content: 'Deleting all kind 10002 events',\n}\n\nrelay.subscribe([\n {\n kinds: [10002],\n authors: [pk],\n },\n], {\n onevent(event) {\n console.log('got event:', event)\n eventTemplate.tags.push(['e', event.id], ['k', '10002'])\n eventCount++\n },\n async oneose() {\n console.log('Got', eventCount, 'events')\n\n if (eventCount \u003e 0) {\n const signedEvent = finalizeEvent(eventTemplate, sk)\n console.log('Deletion event:', signedEvent)\n await relay.publish(signedEvent)\n }\n\n relay.close()\n }\n})\n```",
"sig": "8d754168b76876bc4502e576cdccd2d2fd820947ea723f8767b9a12ee69fcf63a52ebdf3dd043ea871ff83b258b1b6f4bd3c68605ea5441740d58cab603a5e75"
}