Skip to content

Commit

Permalink
chore: Update relay example
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Jul 6, 2024
1 parent 7add7b5 commit 2f1940a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
13 changes: 1 addition & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/libp2p-relay-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ futures-timer = { version = "3.0", features = ["wasm-bindgen"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
libp2p = { workspace = true, features = ["full"] }
async-std = { version = "1", features = ["attributes"] }
tokio = { workspace = true, features = ["full"] }
clap = { version = "4.5", features = ["derive"] }
env_logger = "0.11"
7 changes: 3 additions & 4 deletions packages/libp2p-relay-manager/examples/relay_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct Opts {
connect: Option<Multiaddr>,
}

#[async_std::main]
#[tokio::main]
#[allow(deprecated)]
async fn main() -> anyhow::Result<()> {
env_logger::init();
Expand All @@ -61,15 +61,14 @@ async fn main() -> anyhow::Result<()> {
println!("Local Node: {local_peer_id}");

let mut swarm = SwarmBuilder::with_existing_identity(local_keypair)
.with_async_std()
.with_tokio()
.with_tcp(
libp2p::tcp::Config::default(),
libp2p::noise::Config::new,
libp2p::yamux::Config::default,
)?
.with_quic()
.with_dns()
.await?
.with_dns()?
.with_relay_client(libp2p::noise::Config::new, libp2p::yamux::Config::default)?
.with_behaviour(|kp, relay_client| Behaviour {
ping: Ping::new(Default::default()),
Expand Down

0 comments on commit 2f1940a

Please sign in to comment.