Some people put their local relay addresses (local host) and onion addresses in their relay list. Onion addresses will fail if the client does not support tor and local host addresses are obviously not accessible. I think we should not select and attempt to connect to addresses that are known to be of no use.
Context: I'm observing relay statuses with `Monitor` and noticed many failed connections to localhosts and onions. I'm on v0.44.0
Thread
Login to reply
Replies (3)
Also prefer selecting wss:// over ws://
Maybe even exclude ws:// ?
The new gossip stores keep track of how many events have been received and the timestamp of the last event, so after some time the unreachable relays should not be longer selected.
This doesn't work really well on the in-memory store, if it's initialized and closed often, but will work better with the SQLite implementation.
For the in-memory db I can add an option to avoid using the local/onion relays. Like in the NostrGossipMemory struct. Or in the GossipOptions in the nostr-sdk crate. What do you think?
BTW, if you are interested in supporting onion relays, the nostr-sdk has an embedded tor client (you have to enable the tor feature).
Merged at #a0b8dc139a8de15b726ec2648f6597afd9c7e795