Skip to content

Commit e00cb53

Browse files
authored
fix(libp2p): remove deprecated development_transport
Pull-Request: #4732.
1 parent fd7b5ac commit e00cb53

File tree

3 files changed

+3
-89
lines changed

3 files changed

+3
-89
lines changed

libp2p/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Remove deprecated `libp2p-wasm-ext`.
66
Users should use `libp2p-websocket-websys` instead.
77
See [PR 4694](https://github.com/libp2p/rust-libp2p/pull/4694).
8+
- Remove deprecated `development_transport`.
9+
Use `libp2p::SwarmBuilder` instead.
10+
See [PR 4732](https://github.com/libp2p/rust-libp2p/pull/4732).
811

912
## 0.52.4
1013

libp2p/src/lib.rs

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -170,91 +170,3 @@ pub use self::transport_ext::TransportExt;
170170
pub use libp2p_identity as identity;
171171
pub use libp2p_identity::PeerId;
172172
pub use libp2p_swarm::{Stream, StreamProtocol};
173-
174-
/// Builds a `Transport` based on TCP/IP that supports the most commonly-used features of libp2p:
175-
///
176-
/// * DNS resolution.
177-
/// * Noise protocol encryption.
178-
/// * Websockets.
179-
/// * Yamux for substream multiplexing.
180-
///
181-
/// All async I/O of the transport is based on `async-std`.
182-
///
183-
/// > **Note**: This `Transport` is not suitable for production usage, as its implementation
184-
/// > reserves the right to support additional protocols or remove deprecated protocols.
185-
#[deprecated(note = "Use `libp2p::SwarmBuilder` instead.")]
186-
#[cfg(all(
187-
not(target_arch = "wasm32"),
188-
feature = "tcp",
189-
feature = "dns",
190-
feature = "websocket",
191-
feature = "noise",
192-
feature = "yamux",
193-
feature = "async-std",
194-
))]
195-
pub async fn development_transport(
196-
keypair: identity::Keypair,
197-
) -> std::io::Result<core::transport::Boxed<(PeerId, core::muxing::StreamMuxerBox)>> {
198-
let transport = {
199-
let dns_tcp = dns::async_std::Transport::system(tcp::async_io::Transport::new(
200-
tcp::Config::new().nodelay(true),
201-
))
202-
.await?;
203-
let ws_dns_tcp = websocket::WsConfig::new(
204-
dns::async_std::Transport::system(tcp::async_io::Transport::new(
205-
tcp::Config::new().nodelay(true),
206-
))
207-
.await?,
208-
);
209-
dns_tcp.or_transport(ws_dns_tcp)
210-
};
211-
212-
Ok(transport
213-
.upgrade(core::upgrade::Version::V1)
214-
.authenticate(noise::Config::new(&keypair).unwrap())
215-
.multiplex(yamux::Config::default())
216-
.timeout(std::time::Duration::from_secs(20))
217-
.boxed())
218-
}
219-
220-
/// Builds a `Transport` based on TCP/IP that supports the most commonly-used features of libp2p:
221-
///
222-
/// * DNS resolution.
223-
/// * Noise protocol encryption.
224-
/// * Websockets.
225-
/// * Yamux for substream multiplexing.
226-
///
227-
/// All async I/O of the transport is based on `tokio`.
228-
///
229-
/// > **Note**: This `Transport` is not suitable for production usage, as its implementation
230-
/// > reserves the right to support additional protocols or remove deprecated protocols.
231-
#[deprecated(note = "Use `libp2p::SwarmBuilder` instead.")]
232-
#[cfg(all(
233-
not(target_arch = "wasm32"),
234-
feature = "tcp",
235-
feature = "dns",
236-
feature = "websocket",
237-
feature = "noise",
238-
feature = "yamux",
239-
feature = "tokio",
240-
))]
241-
pub fn tokio_development_transport(
242-
keypair: identity::Keypair,
243-
) -> std::io::Result<core::transport::Boxed<(PeerId, core::muxing::StreamMuxerBox)>> {
244-
let transport = {
245-
let dns_tcp = dns::tokio::Transport::system(tcp::tokio::Transport::new(
246-
tcp::Config::new().nodelay(true),
247-
))?;
248-
let ws_dns_tcp = websocket::WsConfig::new(dns::tokio::Transport::system(
249-
tcp::tokio::Transport::new(tcp::Config::new().nodelay(true)),
250-
)?);
251-
dns_tcp.or_transport(ws_dns_tcp)
252-
};
253-
254-
Ok(transport
255-
.upgrade(core::upgrade::Version::V1)
256-
.authenticate(noise::Config::new(&keypair).unwrap())
257-
.multiplex(yamux::Config::default())
258-
.timeout(std::time::Duration::from_secs(20))
259-
.boxed())
260-
}

libp2p/src/tutorials/ping.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,3 @@
373373
//! [`Transport`]: crate::core::Transport
374374
//! [`PeerId`]: crate::core::PeerId
375375
//! [`Swarm`]: crate::swarm::Swarm
376-
//! [`development_transport`]: crate::development_transport

0 commit comments

Comments
 (0)