What is the recommended way to publish a Nostr::Event to multiples relays ? Currently, it seems that Nostr::Client takes only one relay option which force to recreate the client for each relays in a loop as there is no possibility to set it later on the client instance.
Proposed enhancements:
-
Allows an array of relays in Nostr::Client that would automatically connect and publish to each relays
c = Nostr::Client.new(
private_key: "XXX",
relays: ["wss://nos.lol", "wss://other.relay"] # Not possible ❌
)
e = Nostr::Event.new(...)
e = c.sign(e)
c.connect
c.publish(e)
c.close
-
Allows to set the relay later to keep only one client instance and assign relay in a loop
c = Nostr::Client.new(
private_key: "XXX"
)
e = Nostr::Event.new(...)
e = c.sign(e)
ALL_RELAYS.each do |relay|
c.relay = relay # Not possible ❌
c.connect
c.publish(e)
c.close
end
Solution 1 would be very elegant, what do you think ?
Thank you !
What is the recommended way to publish a
Nostr::Eventto multiples relays ? Currently, it seems thatNostr::Clienttakes only one relay option which force to recreate the client for each relays in a loop as there is no possibility to set it later on the client instance.Proposed enhancements:
Allows an array of relays in
Nostr::Clientthat would automatically connect and publish to each relaysAllows to set the relay later to keep only one client instance and assign relay in a loop
Solution 1 would be very elegant, what do you think ?
Thank you !