Skip to content

Commit

Permalink
Remove hardcoded list of relays
Browse files Browse the repository at this point in the history
Now we use RELAY env var
  • Loading branch information
grunch committed Mar 21, 2023
1 parent b77d63d commit 4cbce4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
6 changes: 5 additions & 1 deletion .env-sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# User private key in nsec format
NSEC_PRIVKEY='nsec1...'
MOSTRO_PUBKEY='npub1...'
# Mostro pubkey in npub format
MOSTRO_PUBKEY='npub1...'
# Comma-separated list of relays
RELAYS='wss://relay.nostr.vision,wss://nostr.zebedee.cloud,wss://nostr.slothy.win,wss://nostr.rewardsbunny.com,wss://nostr.supremestack.xyz,wss://nostr.shawnyeager.net,wss://relay.nostrmoto.xyz,wss://nostr.roundrockbitcoiners.com'
25 changes: 2 additions & 23 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,8 @@ pub async fn connect_nostr() -> Result<Client> {

// Create new client
let client = Client::new(&my_keys);

let relays = vec![
"wss://relay.nostr.vision",
"wss://nostr.zebedee.cloud",
"wss://nostr.slothy.win",
"wss://nostr.rewardsbunny.com",
"wss://nostr.supremestack.xyz",
"wss://nostr.shawnyeager.net",
"wss://relay.nostrmoto.xyz",
"wss://nostr.roundrockbitcoiners.com",
"wss://nostr.utxo.lol",
"wss://nostr-relay.schnitzel.world",
"wss://sg.qemura.xyz",
"wss://nostr.digitalreformation.info",
"wss://nostr-relay.usebitcoin.space",
"wss://nostr.bch.ninja",
"wss://nostr.massmux.com",
"wss://nostr-pub1.southflorida.ninja",
"wss://relay.nostr.nu",
"wss://nostr.easydns.ca",
"wss://nostrical.com",
"wss://relay.damus.io",
];
let relays = var("RELAYS").expect("RELAYS is not set");
let relays = relays.split(',').collect::<Vec<&str>>();

// Add relays
for r in relays.into_iter() {
Expand Down

0 comments on commit 4cbce4b

Please sign in to comment.