From 2f1940a8529c626ca950e5cf759c04721c6301c9 Mon Sep 17 00:00:00 2001 From: Darius Clark Date: Fri, 5 Jul 2024 20:14:41 -0400 Subject: [PATCH] chore: Update relay example --- Cargo.lock | 13 +------------ packages/libp2p-relay-manager/Cargo.toml | 2 +- .../libp2p-relay-manager/examples/relay_client.rs | 7 +++---- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bd952912..7e90876bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,16 +257,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -441,7 +431,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-attributes", "async-channel 1.9.0", "async-global-executor", "async-io 1.13.0", @@ -2846,7 +2835,6 @@ name = "libp2p-relay-manager" version = "0.2.5" dependencies = [ "anyhow", - "async-std", "clap", "env_logger", "futures", @@ -2856,6 +2844,7 @@ dependencies = [ "log", "rand 0.8.5", "thiserror", + "tokio", "void", ] diff --git a/packages/libp2p-relay-manager/Cargo.toml b/packages/libp2p-relay-manager/Cargo.toml index 5b5d2fc4d..d091a4ee8 100644 --- a/packages/libp2p-relay-manager/Cargo.toml +++ b/packages/libp2p-relay-manager/Cargo.toml @@ -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" \ No newline at end of file diff --git a/packages/libp2p-relay-manager/examples/relay_client.rs b/packages/libp2p-relay-manager/examples/relay_client.rs index e3cdc3eee..a484ad4ef 100644 --- a/packages/libp2p-relay-manager/examples/relay_client.rs +++ b/packages/libp2p-relay-manager/examples/relay_client.rs @@ -44,7 +44,7 @@ struct Opts { connect: Option, } -#[async_std::main] +#[tokio::main] #[allow(deprecated)] async fn main() -> anyhow::Result<()> { env_logger::init(); @@ -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()),