Vic on Nostr: This is something I wish I knew about development with nostr ... These errors in the ...
This is something I wish I knew about development with nostr ... These errors in the front end. I can only assume I'm either getting blocked from connecting from the remote servers all at once, or from my end, but don't have a clue how to resolve that
My pattern causing this is essentially ...
import {RelayPool} from 'nostr-relaypool';
const localpool = new RelayPool();
localpool.subscribe(...)
with localpool.close(); when done.
This is called periodically (currently 15 seconds). I've yet to figure out how to setup the logic to open the subscription, poll for new events, and stay open waiting for new ones and do reconnects and resubscribes if it gets disconnected.
Surely there has to be a way to talk to relays that doesn't connect/disconnect over and over.
Published at
2024-08-10 05:40:47Event JSON
{
"id": "0000e7b9263f36f3d6980d6e3dc8757641704a378bf46921cbe8aaa1384f3a19",
"pubkey": "21b419102da8fc0ba90484aec934bf55b7abcf75eedb39124e8d75e491f41a5e",
"created_at": 1723268447,
"kind": 1,
"tags": [
[
"nonce",
"29635",
"16"
]
],
"content": "This is something I wish I knew about development with nostr ... These errors in the front end. I can only assume I'm either getting blocked from connecting from the remote servers all at once, or from my end, but don't have a clue how to resolve that\n\nhttps://i.nostr.build/ihV6L61CT0lMpUcn.png\n\nMy pattern causing this is essentially ...\n\nimport {RelayPool} from 'nostr-relaypool';\nconst localpool = new RelayPool();\nlocalpool.subscribe(...)\nwith localpool.close(); when done.\n\nThis is called periodically (currently 15 seconds). I've yet to figure out how to setup the logic to open the subscription, poll for new events, and stay open waiting for new ones and do reconnects and resubscribes if it gets disconnected.\n\nSurely there has to be a way to talk to relays that doesn't connect/disconnect over and over.\n",
"sig": "ed322b10d9ee912af76aa3a50245b5684e71a05a936b3b425c3387b92a2aeac1a4c86a521734cfe4bf8e30c7a0699994319d6001930fda93f5aa3a1c31ac4ac1"
}