Skip to content

Commit

Permalink
remove formatting, deprecated in examples and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Mar 27, 2023
1 parent 5667da0 commit 6f87618
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 149 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

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

13 changes: 2 additions & 11 deletions examples/chat-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10.0"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"gossipsub",
"mdns",
"noise",
"macros",
"tcp",
"yamux"
] }
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] }
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
18 changes: 2 additions & 16 deletions examples/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,5 @@ clap = { version = "4.1.11", features = ["derive"] }
env_logger = "0.10.0"
futures = "0.3.27"
futures-timer = "3.0"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"dcutr",
"identify",
"macros",
"noise",
"ping",
"relay",
"rendezvous",
"tcp",
"tokio",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
log = "0.4"
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
log = "0.4"
15 changes: 2 additions & 13 deletions examples/distributed-key-value-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,5 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"kad",
"mdns",
"noise",
"macros",
"tcp",
"websocket",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
multiaddr = { version = "0.17.0" }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
15 changes: 2 additions & 13 deletions examples/file-sharing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,5 @@ clap = { version = "4.1.11", features = ["derive"] }
either = "1.8"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"kad",
"noise",
"macros",
"request-response",
"tcp",
"websocket",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
multiaddr = { version = "0.17.0" }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
16 changes: 1 addition & 15 deletions examples/identify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,4 @@ license = "MIT"
async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"dcutr",
"identify",
"macros",
"noise",
"ping",
"relay",
"rendezvous",
"tcp",
"tokio",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
11 changes: 1 addition & 10 deletions examples/ipfs-kad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"kad",
"noise",
"tcp",
"websocket",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "tcp", "websocket", "yamux"] }
18 changes: 2 additions & 16 deletions examples/ipfs-private/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,5 @@ async-trait = "0.1"
either = "1.8"
env_logger = "0.10"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"gossipsub",
"dns",
"identify",
"kad",
"macros",
"noise",
"ping",
"pnet",
"tcp",
"websocket",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
multiaddr = { version = "0.17.0" }
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
14 changes: 2 additions & 12 deletions examples/ping-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,5 @@ license = "MIT"
async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"dns",
"macros",
"noise",
"ping",
"tcp",
"websocket",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
multiaddr = { version = "0.17.0" }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "noise", "ping", "tcp", "websocket", "yamux"] }
multiaddr = { version = "0.17.0" }
2 changes: 1 addition & 1 deletion examples/relay-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10.0"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] }
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] }
15 changes: 2 additions & 13 deletions examples/rendezvous/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10.0"
futures = "0.3.27"
libp2p = { path = "../../libp2p", features = [
"async-std",
"identify",
"macros",
"noise",
"ping",
"rendezvous",
"tcp",
"tokio",
"yamux"
] }
libp2p-mplex = { path = "../../muxers/mplex" }
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
log = "0.4"
tokio = { version = "1.25", features = ["rt-multi-thread", "macros", "time"] }
tokio = { version = "1.25", features = [ "rt-multi-thread", "macros", "time" ] }
20 changes: 4 additions & 16 deletions interop-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@ anyhow = "1"
either = "1.8.0"
env_logger = "0.10.0"
futures = "0.3.27"
libp2p = { path = "../libp2p", features = [
"websocket",
"yamux",
"tcp",
"tokio",
"ping",
"noise",
"tls",
"dns",
"rsa",
"macros"
] }
libp2p = { path = "../libp2p", features = ["websocket", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] }
# libp2p = { path = "../libp2p", features = ["websocket", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] }
libp2p-quic = { path = "../transports/quic", features = ["tokio"] }
libp2p-webrtc = { path = "../transports/webrtc", features = ["tokio"] }
libp2p-mplex = { path = "../muxers/mplex" }
log = "0.4"
rand = "0.8.5"
redis = { version = "0.22.1", default-features = false, features = [
"tokio-comp"
] }
tokio = { version = "1.24.1", features = ["full"] }
redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] }
tokio = { version = "1.24.1", features = ["full"] }
2 changes: 2 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

- Deprecate the `mplex` feature.
The recommended baseline stream multiplexer is `yamux`.
See [PR 3689].

- Deprecate the `quic` and `webrtc` feature.
These two crates are only in alpha state.
Expand All @@ -14,6 +15,7 @@ The recommended baseline stream multiplexer is `yamux`.
- Introduce `libp2p::allow_block_list` module and deprecate `libp2p::Swarm::ban_peer_id`.
See [PR 3590].

[PR 3689]: https://github.com/libp2p/rust-libp2p/pull/3689
[PR 3386]: https://github.com/libp2p/rust-libp2p/pull/3386
[PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580
[PR 3590]: https://github.com/libp2p/rust-libp2p/pull/3590
Expand Down
13 changes: 9 additions & 4 deletions libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ pub use libp2p_mdns as mdns;
#[doc(inline)]
pub use libp2p_metrics as metrics;
#[cfg(feature = "mplex")]
#[deprecated(note = "`mplex` is not recommended anymore. Please use `yamux` instead.")]
// pub use libp2p_mplex as mplex;
#[deprecated(
note = "`mplex` is not recommended anymore. Please use `yamux` instead or depend on `libp2p-mplex` directly if you need it for legacy use cases."
)]
pub mod mplex {
pub use libp2p_mplex::*;
}
Expand Down Expand Up @@ -190,7 +193,8 @@ pub use libp2p_identity::PeerId;
),
feature = "websocket",
feature = "noise",
feature = "yamux",
feature = "mplex",
feature = "yamux"
))]
#[cfg_attr(
all(
Expand Down Expand Up @@ -224,7 +228,7 @@ pub async fn development_transport(
.authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap())
.multiplex(core::upgrade::SelectUpgrade::new(
yamux::YamuxConfig::default(),
yamux::YamuxConfig::default(),
mplex::MplexConfig::default(),
))
.timeout(std::time::Duration::from_secs(20))
.boxed())
Expand All @@ -249,6 +253,7 @@ pub async fn development_transport(
),
feature = "websocket",
feature = "noise",
feature = "mplex",
feature = "yamux"
))]
#[cfg_attr(
Expand Down Expand Up @@ -279,7 +284,7 @@ pub fn tokio_development_transport(
.authenticate(noise::NoiseAuthenticated::xx(&keypair).unwrap())
.multiplex(core::upgrade::SelectUpgrade::new(
yamux::YamuxConfig::default(),
yamux::YamuxConfig::default(),
mplex::MplexConfig::default(),
))
.timeout(std::time::Duration::from_secs(20))
.boxed())
Expand Down

0 comments on commit 6f87618

Please sign in to comment.