Closed ghost closed 1 year ago
Hey thanks. I think its good to enable user to replace all relays.
So if hardcoded relays are a,b,c then user wants to add "d", then he/she can pass on all four "a,b,c,d".
But he user wants to add only "a,b", then they pass "a,b" then c is also removed.
This allows user to totally control relays.
(user will be shown relays being hard coded or being used so they can decide)
But I can do it myself too. No pressure. Just wanted to point out.
first code pull request. This is great. Thank you.
I can make that modification, so basically if user is passing --relay we adopt their relay list for gListRelayUrls1
:fire: :+1:
single relay (prior behaviour)
dart run bin/nostr_console.dart --relay wss://nostr.radixrat.com/
Relay List: [wss://nostr.radixrat.com]
multi-relay
dart run bin/nostr_console.dart --relay wss://nostr.radixrat.com,wss://nostr.zebedee.cloud
Relay List: [wss://nostr.radixrat.com, wss://nostr.zebedee.cloud]
Malformed URLS without wss:// default back to default relays (if user didn't provide any valid relays):
dart run bin/nostr_console.dart --relay wst://nostr.radixrat.com,wst://nostr.zebedee.cloud
The provided relay entry: wst://nostr.radixrat.com does not start with wss://, omitting
The provided relay entry: wst://nostr.zebedee.cloud does not start with wss://, omitting
No valid relays were provided, using the default relay list
Relay List: [wss://relay.damus.io, wss://relay.nostr.info, wss://nostr-relay.wlvs.space]
@vishalxl had to pick up kid from school first, I implemented ability for user to replace entire relay list, log output shown above for a few scenarios, see if that matches what you were thinking of.
i will do two more changes. someone was saying they needed to test ws://localhost, so the check should allow ws:// too.
also I want to change these sets of relays from lists to sets, which they should have been from the starting. so we aren't anyway working with same entries, which even user can by mistake send in. Again, just highlighting here. I will pull in and can do the changes myself unless you are in mood to do it.
i will do two more changes. someone was saying they needed to test ws://localhost, so the check should allow ws:// too.
also I want to change these sets of relays from lists to sets, which they should have been from the starting. so we aren't anyway working with same entries, which even user can by mistake send in. Again, just highlighting here. I will pull in and can do the changes myself unless you are in mood to do it.
I can take a stab at it
ws:// allowed
dart run bin/nostr_console.dart --relay ws://nostr.radixrat.com,ws://nostr.zebedee.cloud
Relay List: {ws://nostr.radixrat.com, ws://nostr.zebedee.cloud}
malformed urls still caught ie: wa://:
The provided relay entry: wa://nostr.radixrat.com does not start with ws:// or wss://, omitting
The provided relay entry: wa://nostr.zebedee.cloud does not start with ws:// or wss://, omitting
No valid relays were provided, using the default relay list
Relay List: {wss://relay.damus.io, wss://relay.nostr.info, wss://nostr-relay.wlvs.space}
since set now we shouldn't need to check for duplicate relay entries, so that was removed
ex passing two dupe relays:
dart run bin/nostr_console.dart --relay wss://relay.damus.io,wss://relay.damus.io
Relay List: {wss://relay.damus.io}
@vishalxl hopefully that covers your last response
left as --relay to maximize backward compatibility, @vishalxl may have something else in mind for this type of feature though just saw someone post a question about it on nostr