diff --git a/pkarr/examples/README.md b/pkarr/examples/README.md index 77f2a57..9483bd0 100644 --- a/pkarr/examples/README.md +++ b/pkarr/examples/README.md @@ -6,8 +6,21 @@ cargo run --example publish ``` +or to use a Relay client: + +```sh +cargo run --features relay --example publish +``` + ## Resolve ```sh cargo run --example resolve ``` + +or to use a Relay client: + +```sh +cargo run --features relay --example resolve +``` + diff --git a/pkarr/examples/publish.rs b/pkarr/examples/publish.rs index 8a37d6f..38d5312 100644 --- a/pkarr/examples/publish.rs +++ b/pkarr/examples/publish.rs @@ -11,12 +11,18 @@ use tracing_subscriber; use std::time::Instant; -use pkarr::{dns, Client, Keypair, SignedPacket}; +use pkarr::{dns, Keypair, SignedPacket}; + +#[cfg(feature = "relay")] +use pkarr::client::relay::Client; +#[cfg(not(feature = "relay"))] +use pkarr::Client; #[tokio::main] async fn main() { tracing_subscriber::fmt() .with_max_level(Level::DEBUG) + .with_env_filter("pkarr") .init(); let client = Client::builder().build().unwrap(); diff --git a/pkarr/examples/resolve.rs b/pkarr/examples/resolve.rs index 4902bee..05f28b5 100644 --- a/pkarr/examples/resolve.rs +++ b/pkarr/examples/resolve.rs @@ -11,10 +11,15 @@ use std::{ time::{Duration, Instant}, }; -use pkarr::{Client, PublicKey}; - use clap::Parser; +use pkarr::PublicKey; + +#[cfg(feature = "relay")] +use pkarr::client::relay::Client; +#[cfg(not(feature = "relay"))] +use pkarr::Client; + #[derive(Parser)] #[command(author, version, about, long_about = None)] struct Cli {