Skip to content

Commit

Permalink
feat(quic): promote to stable release
Browse files Browse the repository at this point in the history
- Cut a stable release of `libp2p-quic`.
- Export `libp2p-quic` as `libp2p::quic`.
- Update examples to use `libp2p-quic` through `libp2p`.

Pull-Request: #4325.
  • Loading branch information
mxinden authored and thomaseizinger committed Aug 20, 2023
1 parent fb4d820 commit 24a1a9d
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 27 deletions.
9 changes: 3 additions & 6 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ libp2p-perf = { version = "0.2.0", path = "protocols/perf" }
libp2p-ping = { version = "0.43.0", path = "protocols/ping" }
libp2p-plaintext = { version = "0.40.0", path = "transports/plaintext" }
libp2p-pnet = { version = "0.23.0", path = "transports/pnet" }
libp2p-quic = { version = "0.9.2-alpha", path = "transports/quic" }
libp2p-quic = { version = "0.9.2", path = "transports/quic" }
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
Expand Down
3 changes: 1 addition & 2 deletions examples/chat-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10.0"
futures = "0.3.28"
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] }
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] }
3 changes: 1 addition & 2 deletions examples/chat-example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ use async_std::io;
use futures::{future::Either, prelude::*, select};
use libp2p::{
core::{muxing::StreamMuxerBox, transport::OrTransport, upgrade},
gossipsub, identity, mdns, noise,
gossipsub, identity, mdns, noise, quic,
swarm::NetworkBehaviour,
swarm::{SwarmBuilder, SwarmEvent},
tcp, yamux, PeerId, Transport,
};
use libp2p_quic as quic;
use std::collections::hash_map::DefaultHasher;
use std::error::Error;
use std::hash::{Hash, Hasher};
Expand Down
3 changes: 1 addition & 2 deletions examples/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ clap = { version = "4.3.21", features = ["derive"] }
env_logger = "0.10.0"
futures = "0.3.28"
futures-timer = "3.0"
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
log = "0.4"
3 changes: 1 addition & 2 deletions examples/dcutr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ use libp2p::{
},
dcutr,
dns::DnsConfig,
identify, identity, noise, ping, relay,
identify, identity, noise, ping, quic, relay,
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
tcp, yamux, PeerId,
};
use libp2p_quic as quic;
use log::info;
use std::error::Error;
use std::str::FromStr;
Expand Down
3 changes: 1 addition & 2 deletions examples/relay-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ async-std = { version = "1.12", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.10.0"
futures = "0.3.28"
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] }
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay", "quic"] }
3 changes: 1 addition & 2 deletions examples/relay-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ use libp2p::{
core::{Multiaddr, Transport},
identify, identity,
identity::PeerId,
noise, ping, relay,
noise, ping, quic, relay,
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
tcp,
};
use libp2p_quic as quic;
use std::error::Error;
use std::net::{Ipv4Addr, Ipv6Addr};

Expand Down
3 changes: 1 addition & 2 deletions interop-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ rand = "0.8.5"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
axum = "0.6"
libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify"] }
libp2p-quic = { workspace = true, features = ["tokio"] }
libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] }
libp2p-webrtc = { workspace = true, features = ["tokio"] }
libp2p-mplex = { path = "../muxers/mplex" }
mime_guess = "2.0"
Expand Down
3 changes: 1 addition & 2 deletions interop-tests/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ pub(crate) mod native {
use libp2p::identity::Keypair;
use libp2p::swarm::{NetworkBehaviour, SwarmBuilder};
use libp2p::websocket::WsConfig;
use libp2p::{noise, tcp, tls, yamux, PeerId, Transport as _};
use libp2p::{noise, quic, tcp, tls, yamux, PeerId, Transport as _};
use libp2p_mplex as mplex;
use libp2p_quic as quic;
use libp2p_webrtc as webrtc;
use redis::AsyncCommands;

Expand Down
4 changes: 4 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.52.3 - unreleased

- Add `libp2p-quic` stable release.

## 0.52.2

- Include gossipsub when compiling for wasm.
Expand Down
9 changes: 6 additions & 3 deletions libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p"
edition = "2021"
rust-version = "1.65.0"
description = "Peer-to-peer networking library"
version = "0.52.2"
version = "0.52.3"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -33,6 +33,7 @@ full = [
"ping",
"plaintext",
"pnet",
"quic",
"relay",
"rendezvous",
"request-response",
Expand All @@ -51,7 +52,7 @@ full = [
"yamux",
]

async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]
async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std"]
autonat = ["dep:libp2p-autonat"]
cbor = ["libp2p-request-response?/cbor"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
Expand All @@ -72,6 +73,7 @@ noise = ["dep:libp2p-noise"]
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
plaintext = ["dep:libp2p-plaintext"]
pnet = ["dep:libp2p-pnet"]
quic = ["dep:libp2p-quic"]
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
rendezvous = ["dep:libp2p-rendezvous"]
request-response = ["dep:libp2p-request-response"]
Expand All @@ -80,7 +82,7 @@ secp256k1 = ["libp2p-identity/secp256k1"]
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
tcp = ["dep:libp2p-tcp"]
tls = ["dep:libp2p-tls"]
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio"]
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio"]
uds = ["dep:libp2p-uds"]
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen"]
wasm-ext = ["dep:libp2p-wasm-ext"]
Expand Down Expand Up @@ -127,6 +129,7 @@ libp2p-deflate = { workspace = true, optional = true }
libp2p-dns = { workspace = true, optional = true }
libp2p-mdns = { workspace = true, optional = true }
libp2p-memory-connection-limits = { workspace = true, optional = true }
libp2p-quic = { workspace = true, optional = true }
libp2p-tcp = { workspace = true, optional = true }
libp2p-tls = { workspace = true, optional = true }
libp2p-uds = { workspace = true, optional = true }
Expand Down
3 changes: 3 additions & 0 deletions libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ pub use libp2p_plaintext as plaintext;
#[cfg(feature = "pnet")]
#[doc(inline)]
pub use libp2p_pnet as pnet;
#[cfg(feature = "quic")]
#[cfg(not(target_arch = "wasm32"))]
pub use libp2p_quic as quic;
#[cfg(feature = "relay")]
#[doc(inline)]
pub use libp2p_relay as relay;
Expand Down
4 changes: 4 additions & 0 deletions transports/quic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.2 - unreleased

- Cut stable release.

## 0.9.2-alpha

- Add support for reusing an existing socket when dialing localhost address.
Expand Down
2 changes: 1 addition & 1 deletion transports/quic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libp2p-quic"
version = "0.9.2-alpha"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
rust-version = { workspace = true }
Expand Down

0 comments on commit 24a1a9d

Please sign in to comment.