mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 07:11:38 +00:00
*: Unfiy how we depend on crates across the workspace (#2886)
This commit is contained in:
@ -175,4 +175,4 @@ required-features = ["gossipsub"]
|
|||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "ipfs-private"
|
name = "ipfs-private"
|
||||||
required-features = ["gossipsub"]
|
required-features = ["gossipsub", "pnet", "yamux", "ping", "noise", "tcp-async-io", "identify"]
|
||||||
|
@ -46,9 +46,7 @@ ring = { version = "0.16.9", features = ["alloc", "std"], default-features = fal
|
|||||||
async-std = { version = "1.6.2", features = ["attributes"] }
|
async-std = { version = "1.6.2", features = ["attributes"] }
|
||||||
base64 = "0.13.0"
|
base64 = "0.13.0"
|
||||||
criterion = "0.4"
|
criterion = "0.4"
|
||||||
libp2p-mplex = { path = "../muxers/mplex" }
|
libp2p = { path = "../", default-features = false, features = ["mplex", "noise"] }
|
||||||
libp2p-noise = { path = "../transports/noise" }
|
|
||||||
libp2p-tcp = { path = "../transports/tcp" }
|
|
||||||
multihash = { version = "0.16", default-features = false, features = ["arb"] }
|
multihash = { version = "0.16", default-features = false, features = ["arb"] }
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
rand07 = { package = "rand", version = "0.7" }
|
rand07 = { package = "rand", version = "0.7" }
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use libp2p_core::identity;
|
use libp2p::core::identity;
|
||||||
use libp2p_core::transport::{MemoryTransport, Transport};
|
use libp2p::core::transport::{MemoryTransport, Transport};
|
||||||
use libp2p_core::upgrade::{self, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
|
use libp2p::core::upgrade::{self, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
|
||||||
use libp2p_mplex::MplexConfig;
|
use libp2p::mplex::MplexConfig;
|
||||||
use libp2p_noise as noise;
|
use libp2p::noise;
|
||||||
use multiaddr::{Multiaddr, Protocol};
|
use multiaddr::{Multiaddr, Protocol};
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use std::{io, pin::Pin};
|
use std::{io, pin::Pin};
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
use libp2p::tcp::GenTcpConfig;
|
||||||
use libp2p::{
|
use libp2p::{
|
||||||
core::upgrade,
|
core::upgrade,
|
||||||
floodsub::{self, Floodsub, FloodsubEvent},
|
floodsub::{self, Floodsub, FloodsubEvent},
|
||||||
@ -56,7 +57,6 @@ use libp2p::{
|
|||||||
PeerId,
|
PeerId,
|
||||||
Transport,
|
Transport,
|
||||||
};
|
};
|
||||||
use libp2p_tcp::GenTcpConfig;
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use tokio::io::{self, AsyncBufReadExt};
|
use tokio::io::{self, AsyncBufReadExt};
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
//! to work, the ipfs node needs to be configured to use gossipsub.
|
//! to work, the ipfs node needs to be configured to use gossipsub.
|
||||||
use async_std::io;
|
use async_std::io;
|
||||||
use futures::{prelude::*, select};
|
use futures::{prelude::*, select};
|
||||||
|
use libp2p::tcp::GenTcpConfig;
|
||||||
use libp2p::{
|
use libp2p::{
|
||||||
core::{
|
core::{
|
||||||
either::EitherTransport, muxing::StreamMuxerBox, transport, transport::upgrade::Version,
|
either::EitherTransport, muxing::StreamMuxerBox, transport, transport::upgrade::Version,
|
||||||
@ -49,7 +50,6 @@ use libp2p::{
|
|||||||
yamux::YamuxConfig,
|
yamux::YamuxConfig,
|
||||||
Multiaddr, NetworkBehaviour, PeerId, Swarm, Transport,
|
Multiaddr, NetworkBehaviour, PeerId, Swarm, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_tcp::GenTcpConfig;
|
|
||||||
use std::{env, error::Error, fs, path::Path, str::FromStr, time::Duration};
|
use std::{env, error::Error, fs, path::Path, str::FromStr, time::Duration};
|
||||||
|
|
||||||
/// Builds the transport that serves as a common ground for all connections.
|
/// Builds the transport that serves as a common ground for all connections.
|
||||||
|
@ -21,10 +21,7 @@ unsigned-varint = "0.7"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = "1.6.2"
|
async-std = "1.6.2"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
libp2p-core = { path = "../../core", default-features = false }
|
libp2p = { path = "../../", default-features = false, features = ["mplex", "plaintext"] }
|
||||||
libp2p-swarm = { path = "../../swarm", default-features = false }
|
|
||||||
libp2p-mplex = { path = "../../muxers/mplex" }
|
|
||||||
libp2p-plaintext = { path = "../../transports/plaintext" }
|
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
rand = "0.7.2"
|
rand = "0.7.2"
|
||||||
rw-stream-sink = { version = "0.3.0", path = "../../misc/rw-stream-sink" }
|
rw-stream-sink = { version = "0.3.0", path = "../../misc/rw-stream-sink" }
|
||||||
|
@ -19,16 +19,16 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use futures::{channel::oneshot, prelude::*, ready};
|
use futures::{channel::oneshot, prelude::*, ready};
|
||||||
use libp2p_core::{
|
use libp2p::core::{
|
||||||
identity,
|
identity,
|
||||||
multiaddr::Protocol,
|
multiaddr::Protocol,
|
||||||
muxing::StreamMuxerBox,
|
muxing::StreamMuxerBox,
|
||||||
transport::{self, MemoryTransport},
|
transport::{self, MemoryTransport},
|
||||||
upgrade, Multiaddr, PeerId, Transport,
|
upgrade, Multiaddr, PeerId, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_mplex::MplexConfig;
|
use libp2p::mplex::MplexConfig;
|
||||||
use libp2p_plaintext::PlainText2Config;
|
use libp2p::plaintext::PlainText2Config;
|
||||||
use libp2p_swarm::{DummyBehaviour, Swarm, SwarmEvent};
|
use libp2p::swarm::{DummyBehaviour, Swarm, SwarmEvent};
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use std::task::Poll;
|
use std::task::Poll;
|
||||||
|
|
||||||
|
@ -27,8 +27,7 @@ async-std = "1.7.0"
|
|||||||
criterion = "0.4"
|
criterion = "0.4"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
libp2p-tcp = { path = "../../transports/tcp" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "plaintext", "mplex"] }
|
||||||
libp2p-plaintext = { path = "../../transports/plaintext" }
|
|
||||||
quickcheck = "0.9"
|
quickcheck = "0.9"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughpu
|
|||||||
use futures::future::poll_fn;
|
use futures::future::poll_fn;
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use futures::{channel::oneshot, future::join};
|
use futures::{channel::oneshot, future::join};
|
||||||
use libp2p_core::muxing::StreamMuxerExt;
|
use libp2p::core::muxing::StreamMuxerExt;
|
||||||
use libp2p_core::{
|
use libp2p::core::{
|
||||||
identity, multiaddr::multiaddr, muxing, transport, upgrade, Multiaddr, PeerId, Transport,
|
identity, multiaddr::multiaddr, muxing, transport, upgrade, Multiaddr, PeerId, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_mplex as mplex;
|
use libp2p::mplex;
|
||||||
use libp2p_plaintext::PlainText2Config;
|
use libp2p::plaintext::PlainText2Config;
|
||||||
use libp2p_tcp::GenTcpConfig;
|
use libp2p::tcp::GenTcpConfig;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ fn tcp_transport(split_send_size: usize) -> BenchTransport {
|
|||||||
let mut mplex = mplex::MplexConfig::default();
|
let mut mplex = mplex::MplexConfig::default();
|
||||||
mplex.set_split_send_size(split_send_size);
|
mplex.set_split_send_size(split_send_size);
|
||||||
|
|
||||||
libp2p_tcp::TcpTransport::new(GenTcpConfig::default().nodelay(true))
|
libp2p::tcp::TcpTransport::new(GenTcpConfig::default().nodelay(true))
|
||||||
.upgrade(upgrade::Version::V1)
|
.upgrade(upgrade::Version::V1)
|
||||||
.authenticate(PlainText2Config { local_public_key })
|
.authenticate(PlainText2Config { local_public_key })
|
||||||
.multiplex(mplex)
|
.multiplex(mplex)
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use futures::{channel::oneshot, prelude::*};
|
use futures::{channel::oneshot, prelude::*};
|
||||||
use libp2p_core::muxing::StreamMuxerExt;
|
use libp2p::core::muxing::StreamMuxerExt;
|
||||||
use libp2p_core::{upgrade, Transport};
|
use libp2p::core::{upgrade, Transport};
|
||||||
use libp2p_tcp::TcpTransport;
|
use libp2p::tcp::TcpTransport;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn async_write() {
|
fn async_write() {
|
||||||
@ -30,7 +30,7 @@ fn async_write() {
|
|||||||
let (tx, rx) = oneshot::channel();
|
let (tx, rx) = oneshot::channel();
|
||||||
|
|
||||||
let bg_thread = async_std::task::spawn(async move {
|
let bg_thread = async_std::task::spawn(async move {
|
||||||
let mplex = libp2p_mplex::MplexConfig::new();
|
let mplex = libp2p::mplex::MplexConfig::new();
|
||||||
|
|
||||||
let mut transport = TcpTransport::default()
|
let mut transport = TcpTransport::default()
|
||||||
.and_then(move |c, e| upgrade::apply(c, mplex, e, upgrade::Version::V1))
|
.and_then(move |c, e| upgrade::apply(c, mplex, e, upgrade::Version::V1))
|
||||||
@ -67,7 +67,7 @@ fn async_write() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
async_std::task::block_on(async {
|
async_std::task::block_on(async {
|
||||||
let mplex = libp2p_mplex::MplexConfig::new();
|
let mplex = libp2p::mplex::MplexConfig::new();
|
||||||
let mut transport = TcpTransport::default()
|
let mut transport = TcpTransport::default()
|
||||||
.and_then(move |c, e| upgrade::apply(c, mplex, e, upgrade::Version::V1));
|
.and_then(move |c, e| upgrade::apply(c, mplex, e, upgrade::Version::V1));
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use futures::{channel::oneshot, prelude::*};
|
use futures::{channel::oneshot, prelude::*};
|
||||||
use libp2p_core::muxing::StreamMuxerExt;
|
use libp2p::core::muxing::StreamMuxerExt;
|
||||||
use libp2p_core::{upgrade, Transport};
|
use libp2p::core::{upgrade, Transport};
|
||||||
use libp2p_tcp::TcpTransport;
|
use libp2p::tcp::TcpTransport;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn client_to_server_outbound() {
|
fn client_to_server_outbound() {
|
||||||
|
@ -29,9 +29,4 @@ prost = "0.11"
|
|||||||
async-std = { version = "1.10", features = ["attributes"] }
|
async-std = { version = "1.10", features = ["attributes"] }
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
clap = {version = "3.1.6", features = ["derive"]}
|
clap = {version = "3.1.6", features = ["derive"]}
|
||||||
|
libp2p = { path = "../../", default-features = false, features = ["autonat", "dns-async-std", "identify", "mplex", "noise", "tcp-async-io", "websocket", "yamux"] }
|
||||||
|
|
||||||
[dev-dependencies.libp2p]
|
|
||||||
path = "../../"
|
|
||||||
default-features = false
|
|
||||||
features = ["autonat", "dns-async-std", "identify", "mplex", "noise", "tcp-async-io", "websocket", "yamux"]
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
use futures::{channel::oneshot, Future, FutureExt, StreamExt};
|
use futures::{channel::oneshot, Future, FutureExt, StreamExt};
|
||||||
use futures_timer::Delay;
|
use futures_timer::Delay;
|
||||||
|
use libp2p::core::{ConnectedPoint, Endpoint};
|
||||||
|
use libp2p::swarm::DialError;
|
||||||
use libp2p::{
|
use libp2p::{
|
||||||
development_transport,
|
development_transport,
|
||||||
identity::Keypair,
|
identity::Keypair,
|
||||||
@ -30,8 +32,6 @@ use libp2p::{
|
|||||||
use libp2p_autonat::{
|
use libp2p_autonat::{
|
||||||
Behaviour, Config, Event, InboundProbeError, InboundProbeEvent, ResponseError,
|
Behaviour, Config, Event, InboundProbeError, InboundProbeEvent, ResponseError,
|
||||||
};
|
};
|
||||||
use libp2p_core::{ConnectedPoint, Endpoint};
|
|
||||||
use libp2p_swarm::DialError;
|
|
||||||
use std::{num::NonZeroU32, time::Duration};
|
use std::{num::NonZeroU32, time::Duration};
|
||||||
|
|
||||||
async fn init_swarm(config: Config) -> Swarm<Behaviour> {
|
async fn init_swarm(config: Config) -> Swarm<Behaviour> {
|
||||||
|
@ -30,10 +30,6 @@ prost-build = "0.11"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
libp2p = { path = "../..", default-features = false, features = ["dcutr", "relay", "plaintext", "identify", "tcp-async-io", "ping", "noise", "dns-async-std"] }
|
libp2p = { path = "../..", default-features = false, features = ["dcutr", "relay", "plaintext", "identify", "tcp-async-io", "ping", "noise", "dns-async-std", "yamux"] }
|
||||||
libp2p-identify = { path = "../identify" }
|
|
||||||
libp2p-plaintext = { path = "../../transports/plaintext" }
|
|
||||||
libp2p-relay = { path = "../relay" }
|
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
clap = {version = "3.1.6", features = ["derive"]}
|
clap = {version = "3.1.6", features = ["derive"]}
|
||||||
|
@ -101,7 +101,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
noise::NoiseAuthenticated::xx(&local_key)
|
noise::NoiseAuthenticated::xx(&local_key)
|
||||||
.expect("Signing libp2p-noise static DH keypair failed."),
|
.expect("Signing libp2p-noise static DH keypair failed."),
|
||||||
)
|
)
|
||||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
.multiplex(libp2p::yamux::YamuxConfig::default())
|
||||||
.boxed();
|
.boxed();
|
||||||
|
|
||||||
#[derive(NetworkBehaviour)]
|
#[derive(NetworkBehaviour)]
|
||||||
|
@ -33,8 +33,8 @@ use libp2p::dcutr;
|
|||||||
use libp2p::plaintext::PlainText2Config;
|
use libp2p::plaintext::PlainText2Config;
|
||||||
use libp2p::relay::v2::client;
|
use libp2p::relay::v2::client;
|
||||||
use libp2p::relay::v2::relay;
|
use libp2p::relay::v2::relay;
|
||||||
|
use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent};
|
||||||
use libp2p::NetworkBehaviour;
|
use libp2p::NetworkBehaviour;
|
||||||
use libp2p_swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent};
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -144,7 +144,7 @@ where
|
|||||||
let transport = transport
|
let transport = transport
|
||||||
.upgrade(Version::V1)
|
.upgrade(Version::V1)
|
||||||
.authenticate(PlainText2Config { local_public_key })
|
.authenticate(PlainText2Config { local_public_key })
|
||||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
.multiplex(libp2p::yamux::YamuxConfig::default())
|
||||||
.boxed();
|
.boxed();
|
||||||
|
|
||||||
transport
|
transport
|
||||||
|
@ -36,10 +36,7 @@ prometheus-client = "0.18.0"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = "1.6.3"
|
async-std = "1.6.3"
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
libp2p-plaintext = { path = "../../transports/plaintext" }
|
libp2p = { path = "../../", default-features = false, features = ["plaintext", "yamux", "noise", "mplex", "gossipsub"] }
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
libp2p-mplex = { path = "../../muxers/mplex" }
|
|
||||||
libp2p-noise = { path = "../../transports/noise" }
|
|
||||||
quickcheck = "0.9.2"
|
quickcheck = "0.9.2"
|
||||||
hex = "0.4.2"
|
hex = "0.4.2"
|
||||||
derive_builder = "0.11.1"
|
derive_builder = "0.11.1"
|
||||||
|
@ -99,8 +99,8 @@
|
|||||||
//! // This is test transport (memory).
|
//! // This is test transport (memory).
|
||||||
//! let transport = MemoryTransport::default()
|
//! let transport = MemoryTransport::default()
|
||||||
//! .upgrade(libp2p_core::upgrade::Version::V1)
|
//! .upgrade(libp2p_core::upgrade::Version::V1)
|
||||||
//! .authenticate(libp2p_noise::NoiseAuthenticated::xx(&local_key).unwrap())
|
//! .authenticate(libp2p::noise::NoiseAuthenticated::xx(&local_key).unwrap())
|
||||||
//! .multiplex(libp2p_mplex::MplexConfig::new())
|
//! .multiplex(libp2p::mplex::MplexConfig::new())
|
||||||
//! .boxed();
|
//! .boxed();
|
||||||
//!
|
//!
|
||||||
//! // Create a Gossipsub topic
|
//! // Create a Gossipsub topic
|
||||||
|
@ -29,16 +29,16 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use libp2p_core::{
|
use libp2p::core::{
|
||||||
identity, multiaddr::Protocol, transport::MemoryTransport, upgrade, Multiaddr, Transport,
|
identity, multiaddr::Protocol, transport::MemoryTransport, upgrade, Multiaddr, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_gossipsub::{
|
use libp2p::gossipsub::{
|
||||||
Gossipsub, GossipsubConfigBuilder, GossipsubEvent, IdentTopic as Topic, MessageAuthenticity,
|
Gossipsub, GossipsubConfigBuilder, GossipsubEvent, IdentTopic as Topic, MessageAuthenticity,
|
||||||
ValidationMode,
|
ValidationMode,
|
||||||
};
|
};
|
||||||
use libp2p_plaintext::PlainText2Config;
|
use libp2p::plaintext::PlainText2Config;
|
||||||
use libp2p_swarm::{Swarm, SwarmEvent};
|
use libp2p::swarm::{Swarm, SwarmEvent};
|
||||||
use libp2p_yamux as yamux;
|
use libp2p::yamux;
|
||||||
|
|
||||||
struct Graph {
|
struct Graph {
|
||||||
pub nodes: Vec<(Multiaddr, Swarm<Gossipsub>)>,
|
pub nodes: Vec<(Multiaddr, Swarm<Gossipsub>)>,
|
||||||
@ -177,9 +177,7 @@ fn build_node() -> (Multiaddr, Swarm<Gossipsub>) {
|
|||||||
let mut addr: Multiaddr = Protocol::Memory(port).into();
|
let mut addr: Multiaddr = Protocol::Memory(port).into();
|
||||||
swarm.listen_on(addr.clone()).unwrap();
|
swarm.listen_on(addr.clone()).unwrap();
|
||||||
|
|
||||||
addr = addr.with(libp2p_core::multiaddr::Protocol::P2p(
|
addr = addr.with(Protocol::P2p(public_key.to_peer_id().into()));
|
||||||
public_key.to_peer_id().into(),
|
|
||||||
));
|
|
||||||
|
|
||||||
(addr, swarm)
|
(addr, swarm)
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,7 @@ thiserror = "1"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
futures-timer = "3.0"
|
futures-timer = "3.0"
|
||||||
libp2p-noise = { path = "../../transports/noise" }
|
libp2p = { path = "../../", default-features = false, features = ["noise", "yamux"] }
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
@ -27,6 +27,9 @@ use crate::record::{store::MemoryStore, Key};
|
|||||||
use crate::K_VALUE;
|
use crate::K_VALUE;
|
||||||
use futures::{executor::block_on, future::poll_fn, prelude::*};
|
use futures::{executor::block_on, future::poll_fn, prelude::*};
|
||||||
use futures_timer::Delay;
|
use futures_timer::Delay;
|
||||||
|
use libp2p::noise;
|
||||||
|
use libp2p::swarm::{Swarm, SwarmEvent};
|
||||||
|
use libp2p::yamux;
|
||||||
use libp2p_core::{
|
use libp2p_core::{
|
||||||
connection::{ConnectedPoint, ConnectionId},
|
connection::{ConnectedPoint, ConnectionId},
|
||||||
identity,
|
identity,
|
||||||
@ -35,9 +38,6 @@ use libp2p_core::{
|
|||||||
transport::MemoryTransport,
|
transport::MemoryTransport,
|
||||||
upgrade, Endpoint, PeerId, Transport,
|
upgrade, Endpoint, PeerId, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_noise as noise;
|
|
||||||
use libp2p_swarm::{Swarm, SwarmEvent};
|
|
||||||
use libp2p_yamux as yamux;
|
|
||||||
use quickcheck::*;
|
use quickcheck::*;
|
||||||
use rand::{random, rngs::StdRng, thread_rng, Rng, SeedableRng};
|
use rand::{random, rngs::StdRng, thread_rng, Rng, SeedableRng};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -22,8 +22,5 @@ void = "1.0"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = "1.6.2"
|
async-std = "1.6.2"
|
||||||
libp2p-tcp = { path = "../../transports/tcp" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "noise", "mplex", "yamux", "ping"] }
|
||||||
libp2p-noise = { path = "../../transports/noise" }
|
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
libp2p-mplex = { path = "../../muxers/mplex" }
|
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
|
@ -21,18 +21,18 @@
|
|||||||
//! Integration tests for the `Ping` network behaviour.
|
//! Integration tests for the `Ping` network behaviour.
|
||||||
|
|
||||||
use futures::{channel::mpsc, prelude::*};
|
use futures::{channel::mpsc, prelude::*};
|
||||||
use libp2p_core::{
|
use libp2p::core::{
|
||||||
identity,
|
identity,
|
||||||
muxing::StreamMuxerBox,
|
muxing::StreamMuxerBox,
|
||||||
transport::{self, Transport},
|
transport::{self, Transport},
|
||||||
upgrade, Multiaddr, PeerId,
|
upgrade, Multiaddr, PeerId,
|
||||||
};
|
};
|
||||||
use libp2p_mplex as mplex;
|
use libp2p::mplex;
|
||||||
use libp2p_noise as noise;
|
use libp2p::noise;
|
||||||
use libp2p_ping as ping;
|
use libp2p::ping;
|
||||||
use libp2p_swarm::{DummyBehaviour, KeepAlive, Swarm, SwarmEvent};
|
use libp2p::swarm::{DummyBehaviour, KeepAlive, Swarm, SwarmEvent};
|
||||||
use libp2p_tcp::{GenTcpConfig, TcpTransport};
|
use libp2p::tcp::{GenTcpConfig, TcpTransport};
|
||||||
use libp2p_yamux as yamux;
|
use libp2p::yamux;
|
||||||
use quickcheck::*;
|
use quickcheck::*;
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
use std::{num::NonZeroU8, time::Duration};
|
use std::{num::NonZeroU8, time::Duration};
|
||||||
|
@ -34,11 +34,6 @@ prost-build = "0.11"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
libp2p = { path = "../..", default-features = false, features = ["identify", "relay", "ping", "noise", "plaintext", "tcp-async-io"] }
|
libp2p = { path = "../..", default-features = false, features = ["identify", "kad", "ping", "plaintext", "tcp-async-io", "relay", "noise", "yamux"] }
|
||||||
libp2p-identify = { path = "../identify" }
|
|
||||||
libp2p-kad = { path = "../kad" }
|
|
||||||
libp2p-ping = { path = "../ping" }
|
|
||||||
libp2p-plaintext = { path = "../../transports/plaintext" }
|
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
quickcheck = "1"
|
quickcheck = "1"
|
||||||
clap = {version = "3.1.6", features = ["derive"]}
|
clap = {version = "3.1.6", features = ["derive"]}
|
||||||
|
@ -54,7 +54,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
noise::NoiseAuthenticated::xx(&local_key)
|
noise::NoiseAuthenticated::xx(&local_key)
|
||||||
.expect("Signing libp2p-noise static DH keypair failed."),
|
.expect("Signing libp2p-noise static DH keypair failed."),
|
||||||
)
|
)
|
||||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
.multiplex(libp2p::yamux::YamuxConfig::default())
|
||||||
.boxed();
|
.boxed();
|
||||||
|
|
||||||
let behaviour = Behaviour {
|
let behaviour = Behaviour {
|
||||||
|
@ -33,8 +33,8 @@ use libp2p::ping::{Ping, PingConfig, PingEvent};
|
|||||||
use libp2p::plaintext::PlainText2Config;
|
use libp2p::plaintext::PlainText2Config;
|
||||||
use libp2p::relay::v2::client;
|
use libp2p::relay::v2::client;
|
||||||
use libp2p::relay::v2::relay;
|
use libp2p::relay::v2::relay;
|
||||||
|
use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent};
|
||||||
use libp2p::NetworkBehaviour;
|
use libp2p::NetworkBehaviour;
|
||||||
use libp2p_swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent};
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -343,7 +343,7 @@ where
|
|||||||
transport
|
transport
|
||||||
.upgrade(upgrade::Version::V1)
|
.upgrade(upgrade::Version::V1)
|
||||||
.authenticate(PlainText2Config { local_public_key })
|
.authenticate(PlainText2Config { local_public_key })
|
||||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
.multiplex(libp2p::yamux::YamuxConfig::default())
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ pub mod harness;
|
|||||||
use crate::harness::{await_event_or_timeout, await_events_or_timeout, new_swarm, SwarmExt};
|
use crate::harness::{await_event_or_timeout, await_events_or_timeout, new_swarm, SwarmExt};
|
||||||
use futures::stream::FuturesUnordered;
|
use futures::stream::FuturesUnordered;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use libp2p_core::identity;
|
use libp2p::core::identity;
|
||||||
use libp2p_rendezvous as rendezvous;
|
use libp2p::rendezvous;
|
||||||
use libp2p_swarm::{DialError, Swarm, SwarmEvent};
|
use libp2p::swarm::{DialError, Swarm, SwarmEvent};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
@ -25,7 +25,5 @@ unsigned-varint = { version = "0.7", features = ["std", "futures"] }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = "1.6.2"
|
async-std = "1.6.2"
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
libp2p-noise = { path = "../../transports/noise" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "noise", "yamux", "request-response"] }
|
||||||
libp2p-tcp = { path = "../../transports/tcp" }
|
|
||||||
libp2p-yamux = { path = "../../muxers/yamux" }
|
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
@ -22,17 +22,17 @@
|
|||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use futures::{channel::mpsc, prelude::*, AsyncWriteExt};
|
use futures::{channel::mpsc, prelude::*, AsyncWriteExt};
|
||||||
use libp2p_core::{
|
use libp2p::core::{
|
||||||
identity,
|
identity,
|
||||||
muxing::StreamMuxerBox,
|
muxing::StreamMuxerBox,
|
||||||
transport::{self, Transport},
|
transport::{self, Transport},
|
||||||
upgrade::{self, read_length_prefixed, write_length_prefixed},
|
upgrade::{self, read_length_prefixed, write_length_prefixed},
|
||||||
Multiaddr, PeerId,
|
Multiaddr, PeerId,
|
||||||
};
|
};
|
||||||
use libp2p_noise::NoiseAuthenticated;
|
use libp2p::noise::NoiseAuthenticated;
|
||||||
use libp2p_request_response::*;
|
use libp2p::request_response::*;
|
||||||
use libp2p_swarm::{Swarm, SwarmEvent};
|
use libp2p::swarm::{Swarm, SwarmEvent};
|
||||||
use libp2p_tcp::{GenTcpConfig, TcpTransport};
|
use libp2p::tcp::{GenTcpConfig, TcpTransport};
|
||||||
use rand::{self, Rng};
|
use rand::{self, Rng};
|
||||||
use std::{io, iter};
|
use std::{io, iter};
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ fn mk_transport() -> (PeerId, transport::Boxed<(PeerId, StreamMuxerBox)>) {
|
|||||||
TcpTransport::new(GenTcpConfig::default().nodelay(true))
|
TcpTransport::new(GenTcpConfig::default().nodelay(true))
|
||||||
.upgrade(upgrade::Version::V1)
|
.upgrade(upgrade::Version::V1)
|
||||||
.authenticate(NoiseAuthenticated::xx(&id_keys).unwrap())
|
.authenticate(NoiseAuthenticated::xx(&id_keys).unwrap())
|
||||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
.multiplex(libp2p::yamux::YamuxConfig::default())
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,6 @@ void = "1"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = { version = "1.6.2", features = ["attributes"] }
|
async-std = { version = "1.6.2", features = ["attributes"] }
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
libp2p = { path = "../", default-features = false, features = ["identify", "ping", "plaintext", "yamux"] }
|
libp2p = { path = "../", default-features = false, features = ["plaintext", "identify", "ping", "noise", "yamux", "mplex", "tcp-async-io"] }
|
||||||
libp2p-mplex = { path = "../muxers/mplex" }
|
|
||||||
libp2p-noise = { path = "../transports/noise" }
|
|
||||||
libp2p-tcp = { path = "../transports/tcp" }
|
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
rand = "0.7.2"
|
rand = "0.7.2"
|
||||||
|
@ -17,6 +17,6 @@ flate2 = "1.0"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = "1.6.2"
|
async-std = "1.6.2"
|
||||||
libp2p-tcp = { path = "../../transports/tcp" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "deflate"] }
|
||||||
quickcheck = "0.9"
|
quickcheck = "0.9"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
use futures::{future, prelude::*};
|
use futures::{future, prelude::*};
|
||||||
use libp2p_core::{transport::Transport, upgrade};
|
use libp2p::core::{transport::Transport, upgrade};
|
||||||
use libp2p_deflate::DeflateConfig;
|
use libp2p::deflate::DeflateConfig;
|
||||||
use libp2p_tcp::TcpTransport;
|
use libp2p::tcp::TcpTransport;
|
||||||
use quickcheck::{QuickCheck, RngCore, TestResult};
|
use quickcheck::{QuickCheck, RngCore, TestResult};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -31,7 +31,7 @@ snow = { version = "0.9.0", features = ["default-resolver"], default-features =
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-io = "1.2.0"
|
async-io = "1.2.0"
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
libp2p-tcp = { path = "../../transports/tcp" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io", "noise"] }
|
||||||
quickcheck = "0.9.0"
|
quickcheck = "0.9.0"
|
||||||
libsodium-sys-stable = { version = "1.19.22", features = ["fetch-latest"] }
|
libsodium-sys-stable = { version = "1.19.22", features = ["fetch-latest"] }
|
||||||
ed25519-compact = "1.0.11"
|
ed25519-compact = "1.0.11"
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use libp2p_core::{identity, Transport, upgrade};
|
//! use libp2p_core::{identity, Transport, upgrade};
|
||||||
//! use libp2p_tcp::TcpTransport;
|
//! use libp2p::tcp::TcpTransport;
|
||||||
//! use libp2p_noise::{Keypair, X25519Spec, NoiseAuthenticated};
|
//! use libp2p::noise::{Keypair, X25519Spec, NoiseAuthenticated};
|
||||||
//!
|
//!
|
||||||
//! # fn main() {
|
//! # fn main() {
|
||||||
//! let id_keys = identity::Keypair::generate_ed25519();
|
//! let id_keys = identity::Keypair::generate_ed25519();
|
||||||
|
@ -23,14 +23,14 @@ use futures::{
|
|||||||
future::{self, Either},
|
future::{self, Either},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
use libp2p_core::identity;
|
use libp2p::core::identity;
|
||||||
use libp2p_core::transport::{self, Transport};
|
use libp2p::core::transport::{self, Transport};
|
||||||
use libp2p_core::upgrade::{self, apply_inbound, apply_outbound, Negotiated};
|
use libp2p::core::upgrade::{self, apply_inbound, apply_outbound, Negotiated};
|
||||||
use libp2p_noise::{
|
use libp2p::noise::{
|
||||||
Keypair, NoiseAuthenticated, NoiseConfig, NoiseError, NoiseOutput, RemoteIdentity, X25519Spec,
|
Keypair, NoiseAuthenticated, NoiseConfig, NoiseError, NoiseOutput, RemoteIdentity, X25519Spec,
|
||||||
X25519,
|
X25519,
|
||||||
};
|
};
|
||||||
use libp2p_tcp::TcpTransport;
|
use libp2p::tcp::TcpTransport;
|
||||||
use log::info;
|
use log::info;
|
||||||
use quickcheck::QuickCheck;
|
use quickcheck::QuickCheck;
|
||||||
use std::{convert::TryInto, io, net::TcpStream};
|
use std::{convert::TryInto, io, net::TcpStream};
|
||||||
|
@ -24,4 +24,4 @@ url = "2.1"
|
|||||||
webpki-roots = "0.22"
|
webpki-roots = "0.22"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
libp2p-tcp = { path = "../tcp" }
|
libp2p = { path = "../../", default-features = false, features = ["tcp-async-io"] }
|
||||||
|
@ -219,8 +219,8 @@ where
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::WsConfig;
|
use super::WsConfig;
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use libp2p_core::{multiaddr::Protocol, Multiaddr, PeerId, Transport};
|
use libp2p::core::{multiaddr::Protocol, Multiaddr, PeerId, Transport};
|
||||||
use libp2p_tcp as tcp;
|
use libp2p::tcp;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dialer_connects_to_listener_ipv4() {
|
fn dialer_connects_to_listener_ipv4() {
|
||||||
|
Reference in New Issue
Block a user