Skip to content

Commit ab01024

Browse files
committed
sdk: update bot example to use nostr-gossip-memory
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 3d09606 commit ab01024

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/nostr-sdk/examples/bot.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
// Copyright (c) 2023-2025 Rust Nostr Developers
33
// Distributed under the MIT software license
44

5+
use nostr_gossip_memory::prelude::*;
56
use nostr_sdk::prelude::*;
67

78
#[tokio::main]
89
async fn main() -> Result<()> {
910
tracing_subscriber::fmt::init();
1011

1112
let keys = Keys::parse("nsec12kcgs78l06p30jz7z7h3n2x2cy99nw2z6zspjdp7qc206887mwvs95lnkx")?;
13+
let gossip = NostrGossipMemory::unbounded();
1214
let client = Client::builder()
1315
.signer(keys.clone())
14-
.opts(ClientOptions::new().gossip(true))
16+
.gossip(gossip)
1517
.build();
1618

1719
println!("Bot public key: {}", keys.public_key().to_bech32()?);

crates/nostr-sdk/src/client/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ impl Client {
7676
/// use nostr_sdk::prelude::*;
7777
///
7878
/// let signer = Keys::generate();
79-
/// let opts = ClientOptions::default().gossip(true);
80-
/// let client: Client = Client::builder().signer(signer).opts(opts).build();
79+
/// let client: Client = Client::builder().signer(signer).build();
8180
/// ```
8281
#[inline]
8382
pub fn builder() -> ClientBuilder {

0 commit comments

Comments
 (0)