diff --git a/Cargo.lock b/Cargo.lock index 35e44dd..95e2427 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4444,17 +4444,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "nostr-memory" -version = "0.44.0" -source = "git+https://github.com/rust-nostr/nostr#6503a7a86e904800de54c8592a6811f5f17cd805" -dependencies = [ - "btreecap", - "nostr", - "nostr-database", - "tokio", -] - [[package]] name = "nostr-sdk" version = "0.44.1" @@ -6613,7 +6602,6 @@ dependencies = [ "nostr-connect", "nostr-gossip-memory", "nostr-lmdb", - "nostr-memory", "nostr-sdk", "petname", "rustls", diff --git a/Cargo.toml b/Cargo.toml index 98d7a38..cc9b945 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ reqwest_client = { git = "https://github.com/zed-industries/zed" } # Nostr nostr-lmdb = { git = "https://github.com/rust-nostr/nostr" } -nostr-memory = { git = "https://github.com/rust-nostr/nostr" } nostr-connect = { git = "https://github.com/rust-nostr/nostr" } nostr-blossom = { git = "https://github.com/rust-nostr/nostr" } nostr-gossip-memory = { git = "https://github.com/rust-nostr/nostr" } diff --git a/crates/state/Cargo.toml b/crates/state/Cargo.toml index ae39528..f3384d7 100644 --- a/crates/state/Cargo.toml +++ b/crates/state/Cargo.toml @@ -10,7 +10,6 @@ common = { path = "../common" } nostr.workspace = true nostr-sdk.workspace = true nostr-lmdb.workspace = true -nostr-memory.workspace = true nostr-gossip-memory.workspace = true nostr-connect.workspace = true nostr-blossom.workspace = true diff --git a/crates/state/src/lib.rs b/crates/state/src/lib.rs index 1734786..155e673 100644 --- a/crates/state/src/lib.rs +++ b/crates/state/src/lib.rs @@ -8,7 +8,6 @@ use gpui::{App, AppContext, Context, Entity, EventEmitter, Global, SharedString, use nostr_connect::prelude::*; use nostr_gossip_memory::prelude::*; use nostr_lmdb::prelude::*; -use nostr_memory::prelude::*; use nostr_sdk::prelude::*; mod blossom; @@ -114,9 +113,17 @@ impl NostrRegistry { // Construct the nostr npubs entity let npubs = cx.new(|_| vec![]); - // Construct the nostr client builder - let mut builder = ClientBuilder::default() + // Construct the nostr lmdb instance + let lmdb = cx.foreground_executor().block_on(async move { + NostrLmdb::open(config_dir().join("nostr")) + .await + .expect("Failed to initialize database") + }); + + // Construct the nostr client + let client = ClientBuilder::default() .signer(signer.clone()) + .database(lmdb) .gossip(NostrGossipMemory::unbounded()) .gossip_config( GossipConfig::default() @@ -125,27 +132,12 @@ impl NostrRegistry { .sync_initial_timeout(Duration::from_millis(600)), ) .automatic_authentication(false) - .verify_subscriptions(false) + .verify_subscriptions(true) .connect_timeout(Duration::from_secs(10)) .sleep_when_idle(SleepWhenIdle::Enabled { timeout: Duration::from_secs(600), - }); - - // Add database if not in debug mode - if !cfg!(debug_assertions) { - // Construct the nostr lmdb instance - let lmdb = cx.foreground_executor().block_on(async move { - NostrLmdb::open(config_dir().join("nostr")) - .await - .expect("Failed to initialize database") - }); - builder = builder.database(lmdb); - } else { - builder = builder.database(MemoryDatabase::unbounded()) - } - - // Build the nostr client - let client = builder.build(); + }) + .build(); // Run at the end of current cycle cx.defer_in(window, |this, _window, cx| { @@ -911,7 +903,7 @@ fn default_messaging_relays() -> Vec { vec![ RelayUrl::parse("wss://nos.lol").unwrap(), RelayUrl::parse("wss://nip17.com").unwrap(), - RelayUrl::parse("wss://relay.0xchat.com").unwrap(), + RelayUrl::parse("wss://auth.nostr1.com").unwrap(), ] }