upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/client.rs b/src/client.rs
index 860562c..7418519 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -43,16 +43,39 @@ pub trait Connect {
43#[async_trait] 43#[async_trait]
44impl Connect for Client { 44impl Connect for Client {
45 fn default() -> Self { 45 fn default() -> Self {
46 Client { 46 let fallback_relays: Vec<String> = if std::env::var("NGITTEST").is_ok() {
47 client: nostr_sdk::Client::new(&nostr::Keys::generate()), 47 vec![
48 fallback_relays: vec![
49 "ws://localhost:8051".to_string(), 48 "ws://localhost:8051".to_string(),
50 "ws://localhost:8052".to_string(), 49 "ws://localhost:8052".to_string(),
51 ], 50 ]
52 more_fallback_relays: vec![ 51 } else {
52 vec![
53 "wss://relayable.org".to_string(),
54 "wss://relay.f7z.io".to_string(),
55 "wss://relay.damus.io".to_string(),
56 "wss://relay.snort.social".to_string(),
57 // "ws://localhost:8080".to_string()
58 ]
59 };
60
61 let more_fallback_relays: Vec<String> = if std::env::var("NGITTEST").is_ok() {
62 vec![
53 "ws://localhost:8055".to_string(), 63 "ws://localhost:8055".to_string(),
54 "ws://localhost:8056".to_string(), 64 "ws://localhost:8056".to_string(),
55 ], 65 ]
66 } else {
67 vec![
68 "wss://nostr.wine/".to_string(),
69 "wss://eden.nostr.land/".to_string(),
70 "wss://relay.nostr.band/".to_string(),
71 // "ws://localhost:8080".to_string()
72 ]
73 };
74
75 Client {
76 client: nostr_sdk::Client::new(&nostr::Keys::generate()),
77 fallback_relays,
78 more_fallback_relays,
56 } 79 }
57 } 80 }
58 fn new(opts: Params) -> Self { 81 fn new(opts: Params) -> Self {