feat: add basic relay management in rust

This commit is contained in:
reya
2024-05-11 12:28:07 +07:00
parent b46a5cf68f
commit 73f80f27fb
16 changed files with 440 additions and 168 deletions

View File

@@ -60,6 +60,10 @@ fn main() {
.add_relay("wss://bostr.nokotaro.work/")
.await
.expect("Cannot connect to bostr.nokotaro.work, please try again later.");
client
.add_relay("wss://purplepag.es/")
.await
.expect("Cannot connect to purplepag.es, please try again later.");
// Connect
client.connect().await;
@@ -92,6 +96,10 @@ fn main() {
Some(vec![]),
))
.invoke_handler(tauri::generate_handler![
nostr::relay::get_relays,
nostr::relay::list_connected_relays,
nostr::relay::connect_relay,
nostr::relay::remove_relay,
nostr::keys::create_keys,
nostr::keys::save_key,
nostr::keys::get_encrypted_key,
@@ -108,7 +116,6 @@ fn main() {
nostr::metadata::get_current_user_profile,
nostr::metadata::get_profile,
nostr::metadata::get_contact_list,
nostr::metadata::get_contact_metadata,
nostr::metadata::create_profile,
nostr::metadata::follow,
nostr::metadata::unfollow,