From 9b70a6141e21e40ffcf74e435f09a0a23492ecbc Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 24 Oct 2022 12:38:47 +1100 Subject: [PATCH 1/4] Deprecate development transports These create circular dependencies to the root libp2p crate in tests. --- CHANGELOG.md | 2 ++ examples/chat.rs | 11 ++++++++--- examples/distributed-key-value-store.rs | 13 +++++++++---- examples/file-sharing.rs | 11 +++++++++-- examples/gossipsub-chat.rs | 12 ++++++++++-- examples/ipfs-kad.rs | 13 +++++++++---- examples/mdns-passive-discovery.rs | 10 ++++++++-- examples/ping.rs | 11 +++++++++-- misc/metrics/examples/metrics/main.rs | 11 +++++++++-- protocols/autonat/examples/autonat_client.rs | 11 ++++++++++- protocols/autonat/examples/autonat_server.rs | 11 ++++++++++- protocols/autonat/tests/test_client.rs | 12 +++++++++--- protocols/autonat/tests/test_server.rs | 12 +++++++++--- protocols/identify/examples/identify.rs | 11 +++++++++-- protocols/mdns/tests/use-async-std.rs | 10 ++++++++-- protocols/mdns/tests/use-tokio.rs | 10 ++++++++-- protocols/rendezvous/examples/discover.rs | 11 +++++++++-- protocols/rendezvous/examples/register.rs | 11 +++++++++-- .../rendezvous/examples/register_with_identify.rs | 8 ++++++-- protocols/rendezvous/examples/rendezvous_point.rs | 8 ++++++-- src/lib.rs | 8 ++++++++ 21 files changed, 174 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4842ad21752..906925114b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,8 +48,10 @@ - Remove deprecated features: `tcp-tokio`, `mdns-tokio`, `dns-tokio`, `tcp-async-io`, `mdns-async-io`, `dns-async-std`. See [PR 3001]. +- Deprecate `development_transport` and `tokio_development_transport`. See [PR XXXX]. [PR 3001]: https://github.com/libp2p/rust-libp2p/pull/3001 +[PR XXXX]: https://github.com/libp2p/rust-libp2p/pull/XXXX # 0.49.0 diff --git a/examples/chat.rs b/examples/chat.rs index e5368b49e80..11e1cb4ef78 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -55,11 +55,13 @@ use futures::{ select, }; use libp2p::{ + core::{upgrade::Version, Transport}, floodsub::{self, Floodsub, FloodsubEvent}, identity, mdns::{Mdns, MdnsConfig, MdnsEvent}, + noise, swarm::SwarmEvent, - Multiaddr, NetworkBehaviour, PeerId, Swarm, + tcp, yamux, Multiaddr, NetworkBehaviour, PeerId, Swarm, }; use std::error::Error; @@ -72,8 +74,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - // Set up an encrypted DNS-enabled TCP Transport over the Mplex and Yamux protocols - let transport = libp2p::development_transport(local_key).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // Create a Floodsub topic let floodsub_topic = floodsub::Topic::new("chat"); diff --git a/examples/distributed-key-value-store.rs b/examples/distributed-key-value-store.rs index de02ddf81be..13ea33761a1 100644 --- a/examples/distributed-key-value-store.rs +++ b/examples/distributed-key-value-store.rs @@ -48,10 +48,12 @@ use libp2p::kad::{ Quorum, Record, }; use libp2p::{ - development_transport, identity, + core::{upgrade::Version, Transport}, + identity, mdns::{Mdns, MdnsConfig, MdnsEvent}, + noise, swarm::SwarmEvent, - NetworkBehaviour, PeerId, Swarm, + tcp, yamux, NetworkBehaviour, PeerId, Swarm, }; use std::error::Error; @@ -63,8 +65,11 @@ async fn main() -> Result<(), Box> { let local_key = identity::Keypair::generate_ed25519(); let local_peer_id = PeerId::from(local_key.public()); - // Set up a an encrypted DNS-enabled TCP Transport over the Mplex protocol. - let transport = development_transport(local_key).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // We create a custom network behaviour that combines Kademlia and mDNS. #[derive(NetworkBehaviour)] diff --git a/examples/file-sharing.rs b/examples/file-sharing.rs index 4e3cad3f187..76d28e5ee02 100644 --- a/examples/file-sharing.rs +++ b/examples/file-sharing.rs @@ -81,8 +81,11 @@ use async_std::io; use async_std::task::spawn; use clap::Parser; use futures::prelude::*; -use libp2p::core::{Multiaddr, PeerId}; +use libp2p::core::{upgrade::Version, Multiaddr, PeerId, Transport}; use libp2p::multiaddr::Protocol; +use libp2p::noise; +use libp2p::tcp; +use libp2p::yamux; use std::error::Error; use std::io::Write; use std::path::PathBuf; @@ -252,7 +255,11 @@ mod network { // Build the Swarm, connecting the lower layer transport logic with the // higher layer network behaviour logic. let swarm = SwarmBuilder::new( - libp2p::development_transport(id_keys).await?, + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), ComposedBehaviour { kademlia: Kademlia::new(peer_id, MemoryStore::new(peer_id)), request_response: RequestResponse::new( diff --git a/examples/gossipsub-chat.rs b/examples/gossipsub-chat.rs index 807209324f6..b67c40da51b 100644 --- a/examples/gossipsub-chat.rs +++ b/examples/gossipsub-chat.rs @@ -49,10 +49,15 @@ use async_std::io; use env_logger::{Builder, Env}; use futures::{prelude::*, select}; +use libp2p::core::upgrade::Version; +use libp2p::core::Transport; use libp2p::gossipsub::MessageId; use libp2p::gossipsub::{ GossipsubEvent, GossipsubMessage, IdentTopic as Topic, MessageAuthenticity, ValidationMode, }; +use libp2p::noise; +use libp2p::tcp; +use libp2p::yamux; use libp2p::{gossipsub, identity, swarm::SwarmEvent, Multiaddr, PeerId}; use std::collections::hash_map::DefaultHasher; use std::error::Error; @@ -68,8 +73,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - // Set up an encrypted TCP Transport over the Mplex and Yamux protocols - let transport = libp2p::development_transport(local_key.clone()).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // Create a Gossipsub topic let topic = Topic::new("test-net"); diff --git a/examples/ipfs-kad.rs b/examples/ipfs-kad.rs index a36ed97737b..b09b633e98d 100644 --- a/examples/ipfs-kad.rs +++ b/examples/ipfs-kad.rs @@ -28,9 +28,11 @@ use futures::StreamExt; use libp2p::kad::record::store::MemoryStore; use libp2p::kad::{GetClosestPeersError, Kademlia, KademliaConfig, KademliaEvent, QueryResult}; use libp2p::{ - development_transport, identity, + core::upgrade::Version, + core::Transport, + identity, noise, swarm::{Swarm, SwarmEvent}, - Multiaddr, PeerId, + tcp, yamux, Multiaddr, PeerId, }; use std::{env, error::Error, str::FromStr, time::Duration}; @@ -49,8 +51,11 @@ async fn main() -> Result<(), Box> { let local_key = identity::Keypair::generate_ed25519(); let local_peer_id = PeerId::from(local_key.public()); - // Set up a an encrypted DNS-enabled TCP Transport over the Mplex protocol - let transport = development_transport(local_key).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // Create a swarm to manage peers and events. let mut swarm = { diff --git a/examples/mdns-passive-discovery.rs b/examples/mdns-passive-discovery.rs index 9ac7e1a45a0..9b66673e7f4 100644 --- a/examples/mdns-passive-discovery.rs +++ b/examples/mdns-passive-discovery.rs @@ -20,10 +20,12 @@ use futures::StreamExt; use libp2p::{ + core::{upgrade::Version, Transport}, identity, mdns::{Mdns, MdnsConfig, MdnsEvent}, + noise, swarm::{Swarm, SwarmEvent}, - PeerId, + tcp, yamux, PeerId, }; use std::error::Error; @@ -37,7 +39,11 @@ async fn main() -> Result<(), Box> { println!("Local peer id: {:?}", peer_id); // Create a transport. - let transport = libp2p::development_transport(id_keys).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // Create an MDNS network behaviour. let behaviour = Mdns::new(MdnsConfig::default())?; diff --git a/examples/ping.rs b/examples/ping.rs index 9be23419e40..c5504706cc4 100644 --- a/examples/ping.rs +++ b/examples/ping.rs @@ -42,7 +42,10 @@ use futures::prelude::*; use libp2p::swarm::{Swarm, SwarmEvent}; -use libp2p::{identity, ping, Multiaddr, NetworkBehaviour, PeerId}; +use libp2p::{ + core::{upgrade::Version, Transport}, + identity, noise, ping, tcp, yamux, Multiaddr, NetworkBehaviour, PeerId, +}; use libp2p_swarm::keep_alive; use std::error::Error; @@ -52,7 +55,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = libp2p::development_transport(local_key).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let mut swarm = Swarm::new(transport, Behaviour::default(), local_peer_id); diff --git a/misc/metrics/examples/metrics/main.rs b/misc/metrics/examples/metrics/main.rs index 0307e32dc1e..c86d9eeea5d 100644 --- a/misc/metrics/examples/metrics/main.rs +++ b/misc/metrics/examples/metrics/main.rs @@ -54,7 +54,10 @@ use futures::stream::StreamExt; use libp2p::core::Multiaddr; use libp2p::metrics::{Metrics, Recorder}; use libp2p::swarm::SwarmEvent; -use libp2p::{identity, ping, NetworkBehaviour, PeerId, Swarm}; +use libp2p::{ + core::{upgrade::Version, Transport}, + identity, noise, ping, tcp, yamux, NetworkBehaviour, PeerId, Swarm, +}; use libp2p_swarm::keep_alive; use log::info; use prometheus_client::registry::Registry; @@ -71,7 +74,11 @@ fn main() -> Result<(), Box> { info!("Local peer id: {:?}", local_peer_id); let mut swarm = Swarm::new( - block_on(libp2p::development_transport(local_key))?, + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), Behaviour::default(), local_peer_id, ); diff --git a/protocols/autonat/examples/autonat_client.rs b/protocols/autonat/examples/autonat_client.rs index c90a5c55060..de0e7a4cb9b 100644 --- a/protocols/autonat/examples/autonat_client.rs +++ b/protocols/autonat/examples/autonat_client.rs @@ -32,10 +32,15 @@ use clap::Parser; use futures::prelude::*; use libp2p::autonat; +use libp2p::core::Transport; use libp2p::identify; use libp2p::multiaddr::Protocol; +use libp2p::noise; use libp2p::swarm::{Swarm, SwarmEvent}; +use libp2p::tcp; +use libp2p::yamux; use libp2p::{identity, Multiaddr, NetworkBehaviour, PeerId}; +use libp2p_core::upgrade::Version; use std::error::Error; use std::net::Ipv4Addr; use std::time::Duration; @@ -63,7 +68,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = libp2p::development_transport(local_key.clone()).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = Behaviour::new(local_key.public()); diff --git a/protocols/autonat/examples/autonat_server.rs b/protocols/autonat/examples/autonat_server.rs index 7bb79383710..88b33d0ca20 100644 --- a/protocols/autonat/examples/autonat_server.rs +++ b/protocols/autonat/examples/autonat_server.rs @@ -31,8 +31,13 @@ use futures::prelude::*; use libp2p::autonat; use libp2p::identify; use libp2p::multiaddr::Protocol; +use libp2p::noise; use libp2p::swarm::{Swarm, SwarmEvent}; +use libp2p::tcp; +use libp2p::yamux; use libp2p::{identity, Multiaddr, NetworkBehaviour, PeerId}; +use libp2p_core::upgrade::Version; +use libp2p_core::Transport; use std::error::Error; use std::net::Ipv4Addr; @@ -53,7 +58,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = libp2p::development_transport(local_key.clone()).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = Behaviour::new(local_key.public()); diff --git a/protocols/autonat/tests/test_client.rs b/protocols/autonat/tests/test_client.rs index 420bcf99829..70af148301a 100644 --- a/protocols/autonat/tests/test_client.rs +++ b/protocols/autonat/tests/test_client.rs @@ -21,10 +21,12 @@ use futures::{channel::oneshot, Future, FutureExt, StreamExt}; use futures_timer::Delay; use libp2p::{ - development_transport, + core::upgrade::Version, + core::Transport, identity::Keypair, + noise, swarm::{AddressScore, Swarm, SwarmEvent}, - Multiaddr, PeerId, + tcp, yamux, Multiaddr, PeerId, }; use libp2p_autonat::{ Behaviour, Config, Event, NatStatus, OutboundProbeError, OutboundProbeEvent, ResponseError, @@ -38,7 +40,11 @@ const TEST_REFRESH_INTERVAL: Duration = Duration::from_secs(2); async fn init_swarm(config: Config) -> Swarm { let keypair = Keypair::generate_ed25519(); let local_id = PeerId::from_public_key(&keypair.public()); - let transport = development_transport(keypair).await.unwrap(); + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = Behaviour::new(local_id, config); Swarm::new(transport, behaviour, local_id) } diff --git a/protocols/autonat/tests/test_server.rs b/protocols/autonat/tests/test_server.rs index b45ae7ecafc..c59f4c111e6 100644 --- a/protocols/autonat/tests/test_server.rs +++ b/protocols/autonat/tests/test_server.rs @@ -23,11 +23,13 @@ use futures_timer::Delay; use libp2p::core::{ConnectedPoint, Endpoint}; use libp2p::swarm::DialError; use libp2p::{ - development_transport, + core::upgrade::Version, + core::Transport, identity::Keypair, multiaddr::Protocol, + noise, swarm::{AddressScore, Swarm, SwarmEvent}, - Multiaddr, PeerId, + tcp, yamux, Multiaddr, PeerId, }; use libp2p_autonat::{ Behaviour, Config, Event, InboundProbeError, InboundProbeEvent, ResponseError, @@ -37,7 +39,11 @@ use std::{num::NonZeroU32, time::Duration}; async fn init_swarm(config: Config) -> Swarm { let keypair = Keypair::generate_ed25519(); let local_id = PeerId::from_public_key(&keypair.public()); - let transport = development_transport(keypair).await.unwrap(); + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = Behaviour::new(local_id, config); Swarm::new(transport, behaviour, local_id) } diff --git a/protocols/identify/examples/identify.rs b/protocols/identify/examples/identify.rs index b02eb1c9ebf..2196c4b0f7e 100644 --- a/protocols/identify/examples/identify.rs +++ b/protocols/identify/examples/identify.rs @@ -37,7 +37,10 @@ //! and will send each other identify info which is then printed to the console. use futures::prelude::*; -use libp2p::{identify, identity, Multiaddr, PeerId}; +use libp2p::{ + core::{upgrade::Version, Transport}, + identify, identity, noise, tcp, yamux, Multiaddr, PeerId, +}; use libp2p_swarm::{Swarm, SwarmEvent}; use std::error::Error; @@ -47,7 +50,11 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = libp2p::development_transport(local_key.clone()).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); // Create a identify network behaviour. let behaviour = identify::Behaviour::new(identify::Config::new( diff --git a/protocols/mdns/tests/use-async-std.rs b/protocols/mdns/tests/use-async-std.rs index 2ddb36355be..1a98bddc27c 100644 --- a/protocols/mdns/tests/use-async-std.rs +++ b/protocols/mdns/tests/use-async-std.rs @@ -20,10 +20,12 @@ use futures::StreamExt; use libp2p::{ + core::{upgrade::Version, Transport}, identity, mdns::{Mdns, MdnsConfig, MdnsEvent}, + noise, swarm::{Swarm, SwarmEvent}, - PeerId, + tcp, yamux, PeerId, }; use std::error::Error; use std::time::Duration; @@ -60,7 +62,11 @@ async fn test_expired_async_std() -> Result<(), Box> { async fn create_swarm(config: MdnsConfig) -> Result, Box> { let id_keys = identity::Keypair::generate_ed25519(); let peer_id = PeerId::from(id_keys.public()); - let transport = libp2p::development_transport(id_keys).await?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = Mdns::new(config)?; let mut swarm = Swarm::new(transport, behaviour, peer_id); swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; diff --git a/protocols/mdns/tests/use-tokio.rs b/protocols/mdns/tests/use-tokio.rs index 830557d3f00..2ac96d9723c 100644 --- a/protocols/mdns/tests/use-tokio.rs +++ b/protocols/mdns/tests/use-tokio.rs @@ -19,10 +19,12 @@ // DEALINGS IN THE SOFTWARE.use futures::StreamExt; use futures::StreamExt; use libp2p::{ + core::{upgrade::Version, Transport}, identity, mdns::{MdnsConfig, MdnsEvent, TokioMdns}, + noise, swarm::{Swarm, SwarmEvent}, - PeerId, + tcp, yamux, PeerId, }; use std::error::Error; use std::time::Duration; @@ -56,7 +58,11 @@ async fn test_expired_tokio() -> Result<(), Box> { async fn create_swarm(config: MdnsConfig) -> Result, Box> { let id_keys = identity::Keypair::generate_ed25519(); let peer_id = PeerId::from(id_keys.public()); - let transport = libp2p::tokio_development_transport(id_keys)?; + let transport = tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) + .multiplex(yamux::YamuxConfig::default()) + .boxed(); let behaviour = TokioMdns::new(config)?; let mut swarm = Swarm::new(transport, behaviour, peer_id); swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; diff --git a/protocols/rendezvous/examples/discover.rs b/protocols/rendezvous/examples/discover.rs index c14e114ee88..07ccbfa8f66 100644 --- a/protocols/rendezvous/examples/discover.rs +++ b/protocols/rendezvous/examples/discover.rs @@ -25,7 +25,10 @@ use libp2p::multiaddr::Protocol; use libp2p::ping; use libp2p::swarm::{keep_alive, SwarmEvent}; use libp2p::Swarm; -use libp2p::{development_transport, rendezvous, Multiaddr}; +use libp2p::{ + core::{upgrade::Version, Transport}, + noise, rendezvous, tcp, yamux, Multiaddr, +}; use std::time::Duration; use void::Void; @@ -42,7 +45,11 @@ async fn main() { .unwrap(); let mut swarm = Swarm::new( - development_transport(identity.clone()).await.unwrap(), + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), MyBehaviour { rendezvous: rendezvous::client::Behaviour::new(identity.clone()), ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), diff --git a/protocols/rendezvous/examples/register.rs b/protocols/rendezvous/examples/register.rs index 3fbfa02785d..cb9fb0fe08a 100644 --- a/protocols/rendezvous/examples/register.rs +++ b/protocols/rendezvous/examples/register.rs @@ -23,7 +23,10 @@ use libp2p::core::identity; use libp2p::core::PeerId; use libp2p::ping; use libp2p::swarm::{Swarm, SwarmEvent}; -use libp2p::{development_transport, rendezvous}; +use libp2p::{ + core::{upgrade::Version, Transport}, + noise, rendezvous, tcp, yamux, +}; use libp2p::{Multiaddr, NetworkBehaviour}; use libp2p_swarm::AddressScore; use std::time::Duration; @@ -40,7 +43,11 @@ async fn main() { let identity = identity::Keypair::generate_ed25519(); let mut swarm = Swarm::new( - development_transport(identity.clone()).await.unwrap(), + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), MyBehaviour { rendezvous: rendezvous::client::Behaviour::new(identity.clone()), ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), diff --git a/protocols/rendezvous/examples/register_with_identify.rs b/protocols/rendezvous/examples/register_with_identify.rs index f12a1a6ed98..93092aee911 100644 --- a/protocols/rendezvous/examples/register_with_identify.rs +++ b/protocols/rendezvous/examples/register_with_identify.rs @@ -24,7 +24,7 @@ use libp2p::core::PeerId; use libp2p::identify; use libp2p::ping; use libp2p::swarm::{keep_alive, Swarm, SwarmEvent}; -use libp2p::{development_transport, rendezvous}; +use libp2p::{core::upgrade::Version, core::Transport, noise, rendezvous, tcp, yamux}; use libp2p::{Multiaddr, NetworkBehaviour}; use std::time::Duration; use void::Void; @@ -41,7 +41,11 @@ async fn main() { let identity = identity::Keypair::generate_ed25519(); let mut swarm = Swarm::new( - development_transport(identity.clone()).await.unwrap(), + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), MyBehaviour { identify: identify::Behaviour::new(identify::Config::new( "rendezvous-example/1.0.0".to_string(), diff --git a/protocols/rendezvous/examples/rendezvous_point.rs b/protocols/rendezvous/examples/rendezvous_point.rs index 980a3a6fd5d..16e35b2bf2a 100644 --- a/protocols/rendezvous/examples/rendezvous_point.rs +++ b/protocols/rendezvous/examples/rendezvous_point.rs @@ -25,7 +25,7 @@ use libp2p::identify; use libp2p::ping; use libp2p::swarm::{keep_alive, Swarm, SwarmEvent}; use libp2p::NetworkBehaviour; -use libp2p::{development_transport, rendezvous}; +use libp2p::{core::upgrade::Version, core::Transport, noise, rendezvous, tcp, yamux}; use void::Void; /// Examples for the rendezvous protocol: @@ -45,7 +45,11 @@ async fn main() { let identity = identity::Keypair::Ed25519(key.into()); let mut swarm = Swarm::new( - development_transport(identity.clone()).await.unwrap(), + tcp::TcpTransport::default() + .upgrade(Version::V1) + .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) + .multiplex(yamux::YamuxConfig::default()) + .boxed(), MyBehaviour { identify: identify::Behaviour::new(identify::Config::new( "rendezvous-example/1.0.0".to_string(), diff --git a/src/lib.rs b/src/lib.rs index d2b4226d2ce..e040df62ca5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -212,6 +212,10 @@ pub use libp2p_swarm_derive::NetworkBehaviour; note = "The `tcp-async-io` and `dns-async-std` features are deprecated. Use the new `tcp` and `dns` features together with the `async-std` feature." ) )] +#[deprecated( + since = "0.50.0", + note = "Compose your own transport, specific to your needs." +)] pub async fn development_transport( keypair: identity::Keypair, ) -> std::io::Result> { @@ -286,6 +290,10 @@ pub async fn development_transport( note = "The `tcp-tokio` and `dns-tokio` features are deprecated. Use the new `tcp` and `dns` feature together with the `tokio` feature." ) )] +#[deprecated( + since = "0.50.0", + note = "Compose your own transport, specific to your needs." +)] pub fn tokio_development_transport( keypair: identity::Keypair, ) -> std::io::Result> { From fc2d8a6c0dbc05fba7c99b0591bf54932c202d02 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 24 Oct 2022 15:57:19 +1100 Subject: [PATCH 2/4] Fill in PR number in changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dda643cda4b..82f126377ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,11 +51,11 @@ - Introduce [`libp2p-tls` `v0.1.0`](transports/tls/CHANGELOG.md#010). See [PR 2945]. - Update individual crates. - Update to [`libp2p-tcp` `v0.38.0`](transports/tcp/CHANGELOG.md#0380). -- Deprecate `development_transport` and `tokio_development_transport`. See [PR XXXX]. +- Deprecate `development_transport` and `tokio_development_transport`. See [PR 3056]. [PR 3001]: https://github.com/libp2p/rust-libp2p/pull/3001 [PR 2945]: https://github.com/libp2p/rust-libp2p/pull/2945 -[PR XXXX]: https://github.com/libp2p/rust-libp2p/pull/XXXX +[PR 3056]: https://github.com/libp2p/rust-libp2p/pull/3056 # 0.49.0 From 8708688b7cf79a55b8a0bb2a24599086d67e5723 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 26 Oct 2022 11:40:49 +1100 Subject: [PATCH 3/4] Update examples to not depend on deprecated symbols --- examples/chat.rs | 2 +- examples/distributed-key-value-store.rs | 2 +- examples/file-sharing.rs | 2 +- examples/gossipsub-chat.rs | 2 +- examples/ipfs-kad.rs | 2 +- examples/mdns-passive-discovery.rs | 2 +- examples/ping.rs | 2 +- misc/metrics/examples/metrics/main.rs | 2 +- protocols/autonat/examples/autonat_client.rs | 2 +- protocols/autonat/examples/autonat_server.rs | 2 +- protocols/autonat/tests/test_client.rs | 2 +- protocols/autonat/tests/test_server.rs | 2 +- protocols/identify/examples/identify.rs | 2 +- protocols/mdns/tests/use-async-std.rs | 2 +- protocols/mdns/tests/use-tokio.rs | 9 +++++++-- protocols/rendezvous/examples/discover.rs | 13 ++++++++----- protocols/rendezvous/examples/register.rs | 12 ++++++++---- .../rendezvous/examples/register_with_identify.rs | 12 ++++++++---- protocols/rendezvous/examples/rendezvous_point.rs | 12 ++++++++---- 19 files changed, 53 insertions(+), 33 deletions(-) diff --git a/examples/chat.rs b/examples/chat.rs index 11e1cb4ef78..86b85eb5b08 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -74,7 +74,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/distributed-key-value-store.rs b/examples/distributed-key-value-store.rs index 13ea33761a1..dbef5034658 100644 --- a/examples/distributed-key-value-store.rs +++ b/examples/distributed-key-value-store.rs @@ -65,7 +65,7 @@ async fn main() -> Result<(), Box> { let local_key = identity::Keypair::generate_ed25519(); let local_peer_id = PeerId::from(local_key.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/file-sharing.rs b/examples/file-sharing.rs index 76d28e5ee02..94c698e4826 100644 --- a/examples/file-sharing.rs +++ b/examples/file-sharing.rs @@ -255,7 +255,7 @@ mod network { // Build the Swarm, connecting the lower layer transport logic with the // higher layer network behaviour logic. let swarm = SwarmBuilder::new( - tcp::TcpTransport::default() + tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/gossipsub-chat.rs b/examples/gossipsub-chat.rs index b67c40da51b..6bd8aacd5dc 100644 --- a/examples/gossipsub-chat.rs +++ b/examples/gossipsub-chat.rs @@ -73,7 +73,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key).unwrap()) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/ipfs-kad.rs b/examples/ipfs-kad.rs index b09b633e98d..0471f4d46a4 100644 --- a/examples/ipfs-kad.rs +++ b/examples/ipfs-kad.rs @@ -51,7 +51,7 @@ async fn main() -> Result<(), Box> { let local_key = identity::Keypair::generate_ed25519(); let local_peer_id = PeerId::from(local_key.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/mdns-passive-discovery.rs b/examples/mdns-passive-discovery.rs index 9b66673e7f4..3195f918b02 100644 --- a/examples/mdns-passive-discovery.rs +++ b/examples/mdns-passive-discovery.rs @@ -39,7 +39,7 @@ async fn main() -> Result<(), Box> { println!("Local peer id: {:?}", peer_id); // Create a transport. - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/examples/ping.rs b/examples/ping.rs index c5504706cc4..779ef47329a 100644 --- a/examples/ping.rs +++ b/examples/ping.rs @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/misc/metrics/examples/metrics/main.rs b/misc/metrics/examples/metrics/main.rs index c86d9eeea5d..48605af3b4c 100644 --- a/misc/metrics/examples/metrics/main.rs +++ b/misc/metrics/examples/metrics/main.rs @@ -74,7 +74,7 @@ fn main() -> Result<(), Box> { info!("Local peer id: {:?}", local_peer_id); let mut swarm = Swarm::new( - tcp::TcpTransport::default() + tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/autonat/examples/autonat_client.rs b/protocols/autonat/examples/autonat_client.rs index de0e7a4cb9b..7c2460a0d6a 100644 --- a/protocols/autonat/examples/autonat_client.rs +++ b/protocols/autonat/examples/autonat_client.rs @@ -68,7 +68,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/autonat/examples/autonat_server.rs b/protocols/autonat/examples/autonat_server.rs index 88b33d0ca20..5b9c09090ae 100644 --- a/protocols/autonat/examples/autonat_server.rs +++ b/protocols/autonat/examples/autonat_server.rs @@ -58,7 +58,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/autonat/tests/test_client.rs b/protocols/autonat/tests/test_client.rs index 70af148301a..2298c16a882 100644 --- a/protocols/autonat/tests/test_client.rs +++ b/protocols/autonat/tests/test_client.rs @@ -40,7 +40,7 @@ const TEST_REFRESH_INTERVAL: Duration = Duration::from_secs(2); async fn init_swarm(config: Config) -> Swarm { let keypair = Keypair::generate_ed25519(); let local_id = PeerId::from_public_key(&keypair.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/autonat/tests/test_server.rs b/protocols/autonat/tests/test_server.rs index c59f4c111e6..b7dbe4e40cd 100644 --- a/protocols/autonat/tests/test_server.rs +++ b/protocols/autonat/tests/test_server.rs @@ -39,7 +39,7 @@ use std::{num::NonZeroU32, time::Duration}; async fn init_swarm(config: Config) -> Swarm { let keypair = Keypair::generate_ed25519(); let local_id = PeerId::from_public_key(&keypair.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap()) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/identify/examples/identify.rs b/protocols/identify/examples/identify.rs index 2196c4b0f7e..a421283dab9 100644 --- a/protocols/identify/examples/identify.rs +++ b/protocols/identify/examples/identify.rs @@ -50,7 +50,7 @@ async fn main() -> Result<(), Box> { let local_peer_id = PeerId::from(local_key.public()); println!("Local peer id: {:?}", local_peer_id); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&local_key)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/mdns/tests/use-async-std.rs b/protocols/mdns/tests/use-async-std.rs index 1a98bddc27c..0c4d0b7a1bc 100644 --- a/protocols/mdns/tests/use-async-std.rs +++ b/protocols/mdns/tests/use-async-std.rs @@ -62,7 +62,7 @@ async fn test_expired_async_std() -> Result<(), Box> { async fn create_swarm(config: MdnsConfig) -> Result, Box> { let id_keys = identity::Keypair::generate_ed25519(); let peer_id = PeerId::from(id_keys.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::async_io::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) .multiplex(yamux::YamuxConfig::default()) diff --git a/protocols/mdns/tests/use-tokio.rs b/protocols/mdns/tests/use-tokio.rs index 2ac96d9723c..eedc0532706 100644 --- a/protocols/mdns/tests/use-tokio.rs +++ b/protocols/mdns/tests/use-tokio.rs @@ -26,6 +26,7 @@ use libp2p::{ swarm::{Swarm, SwarmEvent}, tcp, yamux, PeerId, }; +use libp2p_swarm::SwarmBuilder; use std::error::Error; use std::time::Duration; @@ -58,13 +59,17 @@ async fn test_expired_tokio() -> Result<(), Box> { async fn create_swarm(config: MdnsConfig) -> Result, Box> { let id_keys = identity::Keypair::generate_ed25519(); let peer_id = PeerId::from(id_keys.public()); - let transport = tcp::TcpTransport::default() + let transport = tcp::tokio::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&id_keys)?) .multiplex(yamux::YamuxConfig::default()) .boxed(); let behaviour = TokioMdns::new(config)?; - let mut swarm = Swarm::new(transport, behaviour, peer_id); + let mut swarm = SwarmBuilder::new(transport, behaviour, peer_id) + .executor(Box::new(|f| { + tokio::spawn(f); + })) + .build(); swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; Ok(swarm) } diff --git a/protocols/rendezvous/examples/discover.rs b/protocols/rendezvous/examples/discover.rs index 07ccbfa8f66..643225130db 100644 --- a/protocols/rendezvous/examples/discover.rs +++ b/protocols/rendezvous/examples/discover.rs @@ -23,8 +23,7 @@ use libp2p::core::identity; use libp2p::core::PeerId; use libp2p::multiaddr::Protocol; use libp2p::ping; -use libp2p::swarm::{keep_alive, SwarmEvent}; -use libp2p::Swarm; +use libp2p::swarm::{keep_alive, SwarmBuilder, SwarmEvent}; use libp2p::{ core::{upgrade::Version, Transport}, noise, rendezvous, tcp, yamux, Multiaddr, @@ -44,8 +43,8 @@ async fn main() { .parse() .unwrap(); - let mut swarm = Swarm::new( - tcp::TcpTransport::default() + let mut swarm = SwarmBuilder::new( + tcp::tokio::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) .multiplex(yamux::YamuxConfig::default()) @@ -56,7 +55,11 @@ async fn main() { keep_alive: keep_alive::Behaviour, }, PeerId::from(identity.public()), - ); + ) + .executor(Box::new(|f| { + tokio::spawn(f); + })) + .build(); log::info!("Local peer id: {}", swarm.local_peer_id()); diff --git a/protocols/rendezvous/examples/register.rs b/protocols/rendezvous/examples/register.rs index cb9fb0fe08a..dc6bca95ede 100644 --- a/protocols/rendezvous/examples/register.rs +++ b/protocols/rendezvous/examples/register.rs @@ -22,7 +22,7 @@ use futures::StreamExt; use libp2p::core::identity; use libp2p::core::PeerId; use libp2p::ping; -use libp2p::swarm::{Swarm, SwarmEvent}; +use libp2p::swarm::{SwarmBuilder, SwarmEvent}; use libp2p::{ core::{upgrade::Version, Transport}, noise, rendezvous, tcp, yamux, @@ -42,8 +42,8 @@ async fn main() { let identity = identity::Keypair::generate_ed25519(); - let mut swarm = Swarm::new( - tcp::TcpTransport::default() + let mut swarm = SwarmBuilder::new( + tcp::tokio::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) .multiplex(yamux::YamuxConfig::default()) @@ -53,7 +53,11 @@ async fn main() { ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), }, PeerId::from(identity.public()), - ); + ) + .executor(Box::new(|f| { + tokio::spawn(f); + })) + .build(); // In production the external address should be the publicly facing IP address of the rendezvous point. // This address is recorded in the registration entry by the rendezvous point. diff --git a/protocols/rendezvous/examples/register_with_identify.rs b/protocols/rendezvous/examples/register_with_identify.rs index 93092aee911..7c71056f084 100644 --- a/protocols/rendezvous/examples/register_with_identify.rs +++ b/protocols/rendezvous/examples/register_with_identify.rs @@ -23,7 +23,7 @@ use libp2p::core::identity; use libp2p::core::PeerId; use libp2p::identify; use libp2p::ping; -use libp2p::swarm::{keep_alive, Swarm, SwarmEvent}; +use libp2p::swarm::{keep_alive, SwarmBuilder, SwarmEvent}; use libp2p::{core::upgrade::Version, core::Transport, noise, rendezvous, tcp, yamux}; use libp2p::{Multiaddr, NetworkBehaviour}; use std::time::Duration; @@ -40,8 +40,8 @@ async fn main() { let identity = identity::Keypair::generate_ed25519(); - let mut swarm = Swarm::new( - tcp::TcpTransport::default() + let mut swarm = SwarmBuilder::new( + tcp::tokio::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) .multiplex(yamux::YamuxConfig::default()) @@ -56,7 +56,11 @@ async fn main() { keep_alive: keep_alive::Behaviour, }, PeerId::from(identity.public()), - ); + ) + .executor(Box::new(|f| { + tokio::spawn(f); + })) + .build(); log::info!("Local peer id: {}", swarm.local_peer_id()); diff --git a/protocols/rendezvous/examples/rendezvous_point.rs b/protocols/rendezvous/examples/rendezvous_point.rs index 16e35b2bf2a..9c66e8c9535 100644 --- a/protocols/rendezvous/examples/rendezvous_point.rs +++ b/protocols/rendezvous/examples/rendezvous_point.rs @@ -23,7 +23,7 @@ use libp2p::core::identity; use libp2p::core::PeerId; use libp2p::identify; use libp2p::ping; -use libp2p::swarm::{keep_alive, Swarm, SwarmEvent}; +use libp2p::swarm::{keep_alive, SwarmBuilder, SwarmEvent}; use libp2p::NetworkBehaviour; use libp2p::{core::upgrade::Version, core::Transport, noise, rendezvous, tcp, yamux}; use void::Void; @@ -44,8 +44,8 @@ async fn main() { let key = identity::ed25519::SecretKey::from_bytes(bytes).expect("we always pass 32 bytes"); let identity = identity::Keypair::Ed25519(key.into()); - let mut swarm = Swarm::new( - tcp::TcpTransport::default() + let mut swarm = SwarmBuilder::new( + tcp::tokio::Transport::default() .upgrade(Version::V1) .authenticate(noise::NoiseAuthenticated::xx(&identity).unwrap()) .multiplex(yamux::YamuxConfig::default()) @@ -60,7 +60,11 @@ async fn main() { keep_alive: keep_alive::Behaviour, }, PeerId::from(identity.public()), - ); + ) + .executor(Box::new(|f| { + tokio::spawn(f); + })) + .build(); log::info!("Local peer id: {}", swarm.local_peer_id()); From 1d838a158debfe87e20fd314f0354bf7b53efbed Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 13 Nov 2022 13:09:48 +1100 Subject: [PATCH 4/4] Remove deprecation --- CHANGELOG.md | 2 -- src/lib.rs | 8 -------- 2 files changed, 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d8b0d8a0e0..e4393d2bd3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,7 +53,6 @@ - Remove `NetworkBehaviour` macro export from root crate in favor of re-exported macro from `libp2p::swarm`. Change your import from `libp2p::NetworkBehaviour` to `libp2p::swarm::NetworkBehaviour`. See [PR 3055]. - Feature-gate `NetworkBehaviour` macro behind `macros` feature flag. See [PR 3055]. -- Deprecate `development_transport` and `tokio_development_transport`. See [PR 3056]. - Update individual crates. - Update to [`libp2p-autonat` `v0.89.0`](protocols/autonat/CHANGELOG.md#090). - Update to [`libp2p-core` `v0.38.0`](core/CHANGELOG.md#0380). @@ -84,7 +83,6 @@ [PR 3001]: https://github.com/libp2p/rust-libp2p/pull/3001 [PR 2945]: https://github.com/libp2p/rust-libp2p/pull/2945 [PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055 -[PR 3056]: https://github.com/libp2p/rust-libp2p/pull/3056 # 0.49.0 diff --git a/src/lib.rs b/src/lib.rs index 7bde8d88561..e2468547065 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -178,10 +178,6 @@ pub use self::transport_ext::TransportExt; note = "The `tcp-async-io` and `dns-async-std` features are deprecated. Use the new `tcp` and `dns` features together with the `async-std` feature." ) )] -#[deprecated( - since = "0.50.0", - note = "Compose your own transport, specific to your needs." -)] pub async fn development_transport( keypair: identity::Keypair, ) -> std::io::Result> { @@ -242,10 +238,6 @@ pub async fn development_transport( note = "The `tcp-tokio` and `dns-tokio` features are deprecated. Use the new `tcp` and `dns` feature together with the `tokio` feature." ) )] -#[deprecated( - since = "0.50.0", - note = "Compose your own transport, specific to your needs." -)] pub fn tokio_development_transport( keypair: identity::Keypair, ) -> std::io::Result> {