Why Nostr? What is Njump?
2024-08-10 05:40:47

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.
Author Public Key
npub1yx6pjypd4r7qh2gysjhvjd9l2km6hnm4amdnjyjw3467fy05rf0qfp7kza