From 5c1890e66a148675ac63d25a319b4b7978cf97ad Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 16 May 2018 12:59:36 +0200 Subject: [PATCH] Rename libp2p_swarm to libp2p_core (#189) --- Cargo.toml | 2 +- README.md | 14 +++++++------- {swarm => core}/Cargo.toml | 2 +- {swarm => core}/README.md | 20 ++++++++++---------- {swarm => core}/src/connection_reuse.rs | 22 +++++++++++----------- {swarm => core}/src/either.rs | 0 {swarm => core}/src/lib.rs | 18 +++++++++--------- {swarm => core}/src/muxing.rs | 0 {swarm => core}/src/swarm.rs | 22 +++++++++++----------- {swarm => core}/src/transport/and_then.rs | 0 {swarm => core}/src/transport/choice.rs | 0 {swarm => core}/src/transport/denied.rs | 0 {swarm => core}/src/transport/dummy.rs | 0 {swarm => core}/src/transport/map.rs | 0 {swarm => core}/src/transport/mod.rs | 0 {swarm => core}/src/transport/muxed.rs | 0 {swarm => core}/src/transport/upgrade.rs | 0 {swarm => core}/src/upgrade/apply.rs | 10 +++++----- {swarm => core}/src/upgrade/choice.rs | 0 {swarm => core}/src/upgrade/denied.rs | 0 {swarm => core}/src/upgrade/map.rs | 0 {swarm => core}/src/upgrade/mod.rs | 0 {swarm => core}/src/upgrade/plaintext.rs | 0 {swarm => core}/src/upgrade/simple.rs | 0 {swarm => core}/src/upgrade/traits.rs | 0 {swarm => core}/tests/multiplex.rs | 4 ++-- dns/Cargo.toml | 2 +- dns/src/lib.rs | 2 +- example/Cargo.toml | 2 +- example/examples/echo-dialer.rs | 2 +- example/examples/echo-server.rs | 2 +- example/examples/floodsub.rs | 2 +- example/examples/kademlia.rs | 2 +- example/examples/ping-client.rs | 2 +- example/src/lib.rs | 2 +- floodsub/Cargo.toml | 2 +- floodsub/src/lib.rs | 4 ++-- identify/Cargo.toml | 2 +- identify/src/lib.rs | 2 +- identify/src/protocol.rs | 4 ++-- identify/src/transport.rs | 4 ++-- kad/Cargo.toml | 2 +- kad/src/high_level.rs | 2 +- kad/src/kad_server.rs | 4 ++-- kad/src/lib.rs | 2 +- kad/src/protocol.rs | 4 ++-- mplex/Cargo.toml | 2 +- mplex/src/lib.rs | 2 +- mplex/tests/two_peers.rs | 2 +- ping/Cargo.toml | 2 +- ping/README.md | 6 +++--- ping/src/lib.rs | 12 ++++++------ ratelimit/Cargo.toml | 2 +- ratelimit/src/lib.rs | 2 +- secio/Cargo.toml | 2 +- secio/README.md | 4 ++-- secio/src/lib.rs | 14 +++++++------- tcp-transport/Cargo.toml | 2 +- tcp-transport/src/lib.rs | 2 +- websocket/Cargo.toml | 2 +- websocket/README.md | 4 ++-- websocket/src/lib.rs | 6 +++--- 62 files changed, 115 insertions(+), 115 deletions(-) rename {swarm => core}/Cargo.toml (95%) rename {swarm => core}/README.md (93%) rename {swarm => core}/src/connection_reuse.rs (94%) rename {swarm => core}/src/either.rs (100%) rename {swarm => core}/src/lib.rs (95%) rename {swarm => core}/src/muxing.rs (100%) rename {swarm => core}/src/swarm.rs (92%) rename {swarm => core}/src/transport/and_then.rs (100%) rename {swarm => core}/src/transport/choice.rs (100%) rename {swarm => core}/src/transport/denied.rs (100%) rename {swarm => core}/src/transport/dummy.rs (100%) rename {swarm => core}/src/transport/map.rs (100%) rename {swarm => core}/src/transport/mod.rs (100%) rename {swarm => core}/src/transport/muxed.rs (100%) rename {swarm => core}/src/transport/upgrade.rs (100%) rename {swarm => core}/src/upgrade/apply.rs (87%) rename {swarm => core}/src/upgrade/choice.rs (100%) rename {swarm => core}/src/upgrade/denied.rs (100%) rename {swarm => core}/src/upgrade/map.rs (100%) rename {swarm => core}/src/upgrade/mod.rs (100%) rename {swarm => core}/src/upgrade/plaintext.rs (100%) rename {swarm => core}/src/upgrade/simple.rs (100%) rename {swarm => core}/src/upgrade/traits.rs (100%) rename {swarm => core}/tests/multiplex.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index fb0cb7d7..dff2c7b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ "peerstore", "ping", "secio", - "swarm", + "core", "tcp-transport", "websocket", "multistream-select", diff --git a/README.md b/README.md index 0a2e1460..ba623f0d 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,17 @@ Architecture of the crates of this repository: backends. Used by `peerstore`. - `example`: Example usages of this library. - `libp2p-identify`: Protocol implementation that allows a node A to query another node B what - information B knows about A. Implements the `ConnectionUpgrade` trait of `libp2p-swarm`. + information B knows about A. Implements the `ConnectionUpgrade` trait of `libp2p-core`. - `libp2p-peerstore`: Generic storage for information about remote peers (their multiaddresses and their public key), with multiple possible backends. Each multiaddress also has a time-to-live. - Used by `libp2p-swarm`. + Used by `libp2p-core`. - `libp2p-ping`: Implementation of the `ping` protocol (the exact protocol is specific to libp2p). - Implements the `ConnectionUpgrade` trait of `libp2p-swarm`. + Implements the `ConnectionUpgrade` trait of `libp2p-core`. - `libp2p-secio`: Implementation of the `secio` protocol. Encrypts communications. Implements the - `ConnectionUpgrade` trait of `libp2p-swarm`. -- `libp2p-swarm`: Core library that contains all the traits of *libp2p* and plugs things together. -- `libp2p-tcp-transport`: Implementation of the `Transport` trait of `libp2p-swarm` for TCP/IP. -- `libp2p-websocket`: Implementation of the `Transport` trait of `libp2p-swarm` for Websockets. + `ConnectionUpgrade` trait of `libp2p-core`. +- `libp2p-core`: Core library that contains all the traits of *libp2p* and plugs things together. +- `libp2p-tcp-transport`: Implementation of the `Transport` trait of `libp2p-core` for TCP/IP. +- `libp2p-websocket`: Implementation of the `Transport` trait of `libp2p-core` for Websockets. - `multistream-select`: Implementation of the `multistream-select` protocol, which is used to negotiate a protocol over a newly-established connection with a peer, or after a connection upgrade. diff --git a/swarm/Cargo.toml b/core/Cargo.toml similarity index 95% rename from swarm/Cargo.toml rename to core/Cargo.toml index 115bc8d1..2d61d036 100644 --- a/swarm/Cargo.toml +++ b/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "libp2p-swarm" +name = "libp2p-core" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/swarm/README.md b/core/README.md similarity index 93% rename from swarm/README.md rename to core/README.md index 55a233fe..5bb621be 100644 --- a/swarm/README.md +++ b/core/README.md @@ -1,4 +1,4 @@ -# libp2p-swarm +# libp2p-core Transport, protocol upgrade and swarm systems of *libp2p*. @@ -64,15 +64,15 @@ listener. An error is produced if the remote doesn't support the protocol corres connection upgrade. ```rust -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate tokio_core; -use libp2p_swarm::Transport; +use libp2p_core::Transport; let tokio_core = tokio_core::reactor::Core::new().unwrap(); let tcp_transport = libp2p_tcp_transport::TcpConfig::new(tokio_core.handle()); -let upgraded = tcp_transport.with_upgrade(libp2p_swarm::PlainTextConfig); +let upgraded = tcp_transport.with_upgrade(libp2p_core::PlainTextConfig); // upgraded.dial(...) // automatically applies the plain text protocol on the socket ``` @@ -109,13 +109,13 @@ way to use the protocol. ```rust extern crate futures; extern crate libp2p_ping; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate tokio_core; use futures::Future; use libp2p_ping::Ping; -use libp2p_swarm::Transport; +use libp2p_core::Transport; let mut core = tokio_core::reactor::Core::new().unwrap(); @@ -124,7 +124,7 @@ let ping_finished_future = libp2p_tcp_transport::TcpConfig::new(core.handle()) .with_upgrade(Ping) // TODO: right now the only available protocol is ping, but we want to replace it with // something that is more simple to use - .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) + .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) .and_then(|((mut pinger, service), _)| { pinger.ping().map_err(|_| panic!()).select(service).map_err(|_| panic!()) }); @@ -149,20 +149,20 @@ actual protocol, as explained above) into a `Future` producing `()`. ```rust extern crate futures; extern crate libp2p_ping; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate tokio_core; use futures::Future; use libp2p_ping::Ping; -use libp2p_swarm::Transport; +use libp2p_core::Transport; let mut core = tokio_core::reactor::Core::new().unwrap(); let transport = libp2p_tcp_transport::TcpConfig::new(core.handle()) .with_dummy_muxing(); -let (swarm_controller, swarm_future) = libp2p_swarm::swarm(transport, Ping, |(mut pinger, service), client_addr| { +let (swarm_controller, swarm_future) = libp2p_core::swarm(transport, Ping, |(mut pinger, service), client_addr| { pinger.ping().map_err(|_| panic!()) .select(service).map_err(|_| panic!()) .map(|_| ()) diff --git a/swarm/src/connection_reuse.rs b/core/src/connection_reuse.rs similarity index 94% rename from swarm/src/connection_reuse.rs rename to core/src/connection_reuse.rs index 2764544b..a1439956 100644 --- a/swarm/src/connection_reuse.rs +++ b/core/src/connection_reuse.rs @@ -172,11 +172,11 @@ where let inner = self.inner; let future = substream.and_then(move |outbound| { if let Some(o) = outbound { - debug!(target: "libp2p-swarm", "Using existing multiplexed connection to {}", addr); + debug!(target: "libp2p-core", "Using existing multiplexed connection to {}", addr); return Either::A(future::ok(o)); } // The previous stream muxer did not yield a new substream => start new dial - debug!(target: "libp2p-swarm", "No existing connection to {}; dialing", addr); + debug!(target: "libp2p-core", "No existing connection to {}; dialing", addr); match inner.dial(addr.clone()) { Ok(dial) => { let future = dial.into_future().and_then(move |(muxer, addr)| { @@ -193,7 +193,7 @@ where )); Ok((s, addr)) } else { - error!(target: "libp2p-swarm", "failed to dial to {}", addr); + error!(target: "libp2p-core", "failed to dial to {}", addr); shared.lock().active_connections.remove(&addr); Err(io::Error::new(io::ErrorKind::Other, "dial failed")) } @@ -273,13 +273,13 @@ where } Ok(Async::NotReady) => {} Ok(Async::Ready(None)) => { - debug!(target: "libp2p-swarm", "listener has been closed"); + debug!(target: "libp2p-core", "listener has been closed"); if self.connections.is_empty() && self.current_upgrades.is_empty() { return Ok(Async::Ready(None)); } } Err(err) => { - debug!(target: "libp2p-swarm", "error while polling listener: {:?}", err); + debug!(target: "libp2p-core", "error while polling listener: {:?}", err); if self.connections.is_empty() && self.current_upgrades.is_empty() { return Err(err); } @@ -296,7 +296,7 @@ where } Err(err) => { // Insert the rest of the pending upgrades, but not the current one. - debug!(target: "libp2p-swarm", "error while upgrading listener connection: \ + debug!(target: "libp2p-core", "error while upgrading listener connection: \ {:?}", err); return Ok(Async::Ready(Some(future::err(err)))); } @@ -309,7 +309,7 @@ where match next_incoming.poll() { Ok(Async::Ready(None)) => { // stream muxer gave us a `None` => connection should be considered closed - debug!(target: "libp2p-swarm", "no more inbound substreams on {}", client_addr); + debug!(target: "libp2p-core", "no more inbound substreams on {}", client_addr); self.shared.lock().active_connections.remove(&client_addr); } Ok(Async::Ready(Some(incoming))) => { @@ -331,7 +331,7 @@ where self.connections.push((muxer, next_incoming, client_addr)); } Err(err) => { - debug!(target: "libp2p-swarm", "error while upgrading the \ + debug!(target: "libp2p-core", "error while upgrading the \ multiplexed incoming connection: {:?}", err); // Insert the rest of the pending connections, but not the current one. return Ok(Async::Ready(Some(future::err(err)))); @@ -384,13 +384,13 @@ where let (muxer, mut future, addr) = lock.next_incoming.swap_remove(n); match future.poll() { Ok(Async::Ready(None)) => { - debug!(target: "libp2p-swarm", "no inbound substream for {}", addr); + debug!(target: "libp2p-core", "no inbound substream for {}", addr); lock.active_connections.remove(&addr); } Ok(Async::Ready(Some(value))) => { // A substream is ready ; push back the muxer for the next time this function // is called, then return. - debug!(target: "libp2p-swarm", "New incoming substream"); + debug!(target: "libp2p-core", "New incoming substream"); let next = muxer.clone().inbound(); lock.next_incoming.push((muxer, next, addr.clone())); return Ok(Async::Ready(future::ok((value, addr)))); @@ -400,7 +400,7 @@ where } Err(err) => { // In case of error, we just not push back the element, which drops it. - debug!(target: "libp2p-swarm", "ConnectionReuse incoming: one of the \ + debug!(target: "libp2p-core", "ConnectionReuse incoming: one of the \ multiplexed substreams produced an error: {:?}", err); } diff --git a/swarm/src/either.rs b/core/src/either.rs similarity index 100% rename from swarm/src/either.rs rename to core/src/either.rs diff --git a/swarm/src/lib.rs b/core/src/lib.rs similarity index 95% rename from swarm/src/lib.rs rename to core/src/lib.rs index 274f3ce4..728ab03a 100644 --- a/swarm/src/lib.rs +++ b/core/src/lib.rs @@ -85,16 +85,16 @@ //! connection upgrade. //! //! ``` -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_tcp_transport; //! extern crate tokio_core; //! -//! use libp2p_swarm::Transport; +//! use libp2p_core::Transport; //! //! # fn main() { //! let tokio_core = tokio_core::reactor::Core::new().unwrap(); //! let tcp_transport = libp2p_tcp_transport::TcpConfig::new(tokio_core.handle()); -//! let upgraded = tcp_transport.with_upgrade(libp2p_swarm::upgrade::PlainTextConfig); +//! let upgraded = tcp_transport.with_upgrade(libp2p_core::upgrade::PlainTextConfig); //! //! // upgraded.dial(...) // automatically applies the plain text protocol on the socket //! # } @@ -132,13 +132,13 @@ //! ```no_run //! extern crate futures; //! extern crate libp2p_ping; -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_tcp_transport; //! extern crate tokio_core; //! //! use futures::Future; //! use libp2p_ping::Ping; -//! use libp2p_swarm::Transport; +//! use libp2p_core::Transport; //! //! # fn main() { //! let mut core = tokio_core::reactor::Core::new().unwrap(); @@ -148,7 +148,7 @@ //! .with_upgrade(Ping) //! // TODO: right now the only available protocol is ping, but we want to replace it with //! // something that is more simple to use -//! .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) +//! .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) //! .and_then(|((mut pinger, service), _)| { //! pinger.ping().map_err(|_| panic!()).select(service).map_err(|_| panic!()) //! }); @@ -174,13 +174,13 @@ //! ```no_run //! extern crate futures; //! extern crate libp2p_ping; -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_tcp_transport; //! extern crate tokio_core; //! //! use futures::Future; //! use libp2p_ping::Ping; -//! use libp2p_swarm::Transport; +//! use libp2p_core::Transport; //! //! # fn main() { //! let mut core = tokio_core::reactor::Core::new().unwrap(); @@ -188,7 +188,7 @@ //! let transport = libp2p_tcp_transport::TcpConfig::new(core.handle()) //! .with_dummy_muxing(); //! -//! let (swarm_controller, swarm_future) = libp2p_swarm::swarm(transport.with_upgrade(Ping), +//! let (swarm_controller, swarm_future) = libp2p_core::swarm(transport.with_upgrade(Ping), //! |(mut pinger, service), client_addr| { //! pinger.ping().map_err(|_| panic!()) //! .select(service).map_err(|_| panic!()) diff --git a/swarm/src/muxing.rs b/core/src/muxing.rs similarity index 100% rename from swarm/src/muxing.rs rename to core/src/muxing.rs diff --git a/swarm/src/swarm.rs b/core/src/swarm.rs similarity index 92% rename from swarm/src/swarm.rs rename to core/src/swarm.rs index 07399a77..260e5612 100644 --- a/swarm/src/swarm.rs +++ b/core/src/swarm.rs @@ -118,7 +118,7 @@ where Du: Transport + 'static, // TODO: 'static :-/ Du::Output: Into, { - trace!(target: "libp2p-swarm", "Swarm dialing {}", multiaddr); + trace!(target: "libp2p-core", "Swarm dialing {}", multiaddr); match transport.dial(multiaddr.clone()) { Ok(dial) => { @@ -152,7 +152,7 @@ where Df: FnOnce(Du::Output, Multiaddr) -> Dfu + 'static, // TODO: 'static :-/ Dfu: IntoFuture + 'static, // TODO: 'static :-/ { - trace!(target: "libp2p-swarm", "Swarm dialing {} with custom handler", multiaddr); + trace!(target: "libp2p-core", "Swarm dialing {} with custom handler", multiaddr); match transport.dial(multiaddr) { Ok(dial) => { @@ -171,7 +171,7 @@ where pub fn listen_on(&self, multiaddr: Multiaddr) -> Result { match self.transport.clone().listen_on(multiaddr) { Ok((listener, new_addr)) => { - trace!(target: "libp2p-swarm", "Swarm listening on {}", new_addr); + trace!(target: "libp2p-core", "Swarm listening on {}", new_addr); // Ignoring errors if the receiver has been closed, because in that situation // nothing is going to be processed anyway. let _ = self.new_listeners.unbounded_send(listener); @@ -225,14 +225,14 @@ where match self.next_incoming.poll() { Ok(Async::Ready(connec)) => { - debug!(target: "libp2p-swarm", "Swarm received new multiplexed \ + debug!(target: "libp2p-core", "Swarm received new multiplexed \ incoming connection"); self.next_incoming = self.transport.clone().next_incoming(); self.listeners_upgrade.push(Box::new(connec) as Box<_>); } Ok(Async::NotReady) => {} Err(err) => { - debug!(target: "libp2p-swarm", "Error in multiplexed incoming \ + debug!(target: "libp2p-core", "Error in multiplexed incoming \ connection: {:?}", err); self.next_incoming = self.transport.clone().next_incoming(); } @@ -273,12 +273,12 @@ where match self.listeners.poll() { Ok(Async::Ready(Some((Some(upgrade), remaining)))) => { - trace!(target: "libp2p-swarm", "Swarm received new connection on listener socket"); + trace!(target: "libp2p-core", "Swarm received new connection on listener socket"); self.listeners_upgrade.push(upgrade); self.listeners.push(remaining.into_future()); } Err((err, _)) => { - warn!(target: "libp2p-swarm", "Error in listener: {:?}", err); + warn!(target: "libp2p-core", "Error in listener: {:?}", err); } _ => {} } @@ -294,7 +294,7 @@ where )); } Err(err) => { - warn!(target: "libp2p-swarm", "Error in listener upgrade: {:?}", err); + warn!(target: "libp2p-core", "Error in listener upgrade: {:?}", err); } _ => {} } @@ -306,17 +306,17 @@ where .push(future::Either::A(handler(output, addr).into_future())); } Err(err) => { - warn!(target: "libp2p-swarm", "Error in dialer upgrade: {:?}", err); + warn!(target: "libp2p-core", "Error in dialer upgrade: {:?}", err); } _ => {} } match self.to_process.poll() { Ok(Async::Ready(Some(()))) => { - trace!(target: "libp2p-swarm", "Future returned by swarm handler driven to completion"); + trace!(target: "libp2p-core", "Future returned by swarm handler driven to completion"); } Err(err) => { - warn!(target: "libp2p-swarm", "Error in processing: {:?}", err); + warn!(target: "libp2p-core", "Error in processing: {:?}", err); } _ => {} } diff --git a/swarm/src/transport/and_then.rs b/core/src/transport/and_then.rs similarity index 100% rename from swarm/src/transport/and_then.rs rename to core/src/transport/and_then.rs diff --git a/swarm/src/transport/choice.rs b/core/src/transport/choice.rs similarity index 100% rename from swarm/src/transport/choice.rs rename to core/src/transport/choice.rs diff --git a/swarm/src/transport/denied.rs b/core/src/transport/denied.rs similarity index 100% rename from swarm/src/transport/denied.rs rename to core/src/transport/denied.rs diff --git a/swarm/src/transport/dummy.rs b/core/src/transport/dummy.rs similarity index 100% rename from swarm/src/transport/dummy.rs rename to core/src/transport/dummy.rs diff --git a/swarm/src/transport/map.rs b/core/src/transport/map.rs similarity index 100% rename from swarm/src/transport/map.rs rename to core/src/transport/map.rs diff --git a/swarm/src/transport/mod.rs b/core/src/transport/mod.rs similarity index 100% rename from swarm/src/transport/mod.rs rename to core/src/transport/mod.rs diff --git a/swarm/src/transport/muxed.rs b/core/src/transport/muxed.rs similarity index 100% rename from swarm/src/transport/muxed.rs rename to core/src/transport/muxed.rs diff --git a/swarm/src/transport/upgrade.rs b/core/src/transport/upgrade.rs similarity index 100% rename from swarm/src/transport/upgrade.rs rename to core/src/transport/upgrade.rs diff --git a/swarm/src/upgrade/apply.rs b/core/src/upgrade/apply.rs similarity index 87% rename from swarm/src/upgrade/apply.rs rename to core/src/upgrade/apply.rs index 5a6b5cf2..57082d6d 100644 --- a/swarm/src/upgrade/apply.rs +++ b/core/src/upgrade/apply.rs @@ -45,7 +45,7 @@ where .protocol_names() .map::<_, fn(_) -> _>(|(n, t)| (n, ::eq, t)); let remote_addr2 = remote_addr.clone(); - debug!(target: "libp2p-swarm", "Starting protocol negotiation"); + debug!(target: "libp2p-core", "Starting protocol negotiation"); let negotiation = match endpoint { Endpoint::Listener => multistream_select::listener_select_proto(connection, iter), @@ -56,9 +56,9 @@ where .map_err(|err| IoError::new(IoErrorKind::Other, err)) .then(move |negotiated| { match negotiated { - Ok(_) => debug!(target: "libp2p-swarm", "Successfully negotiated \ + Ok(_) => debug!(target: "libp2p-core", "Successfully negotiated \ protocol upgrade with {}", remote_addr2), - Err(ref err) => debug!(target: "libp2p-swarm", "Error while negotiated \ + Err(ref err) => debug!(target: "libp2p-core", "Error while negotiated \ protocol upgrade: {:?}", err), }; negotiated @@ -70,9 +70,9 @@ where .into_future() .then(|val| { match val { - Ok(_) => debug!(target: "libp2p-swarm", "Successfully applied negotiated \ + Ok(_) => debug!(target: "libp2p-core", "Successfully applied negotiated \ protocol"), - Err(_) => debug!(target: "libp2p-swarm", "Failed to apply negotiated protocol"), + Err(_) => debug!(target: "libp2p-core", "Failed to apply negotiated protocol"), } val }); diff --git a/swarm/src/upgrade/choice.rs b/core/src/upgrade/choice.rs similarity index 100% rename from swarm/src/upgrade/choice.rs rename to core/src/upgrade/choice.rs diff --git a/swarm/src/upgrade/denied.rs b/core/src/upgrade/denied.rs similarity index 100% rename from swarm/src/upgrade/denied.rs rename to core/src/upgrade/denied.rs diff --git a/swarm/src/upgrade/map.rs b/core/src/upgrade/map.rs similarity index 100% rename from swarm/src/upgrade/map.rs rename to core/src/upgrade/map.rs diff --git a/swarm/src/upgrade/mod.rs b/core/src/upgrade/mod.rs similarity index 100% rename from swarm/src/upgrade/mod.rs rename to core/src/upgrade/mod.rs diff --git a/swarm/src/upgrade/plaintext.rs b/core/src/upgrade/plaintext.rs similarity index 100% rename from swarm/src/upgrade/plaintext.rs rename to core/src/upgrade/plaintext.rs diff --git a/swarm/src/upgrade/simple.rs b/core/src/upgrade/simple.rs similarity index 100% rename from swarm/src/upgrade/simple.rs rename to core/src/upgrade/simple.rs diff --git a/swarm/src/upgrade/traits.rs b/core/src/upgrade/traits.rs similarity index 100% rename from swarm/src/upgrade/traits.rs rename to core/src/upgrade/traits.rs diff --git a/swarm/tests/multiplex.rs b/core/tests/multiplex.rs similarity index 99% rename from swarm/tests/multiplex.rs rename to core/tests/multiplex.rs index 0ffed4ec..7a6301db 100644 --- a/swarm/tests/multiplex.rs +++ b/core/tests/multiplex.rs @@ -21,7 +21,7 @@ extern crate bytes; extern crate futures; extern crate libp2p_mplex as multiplex; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate tokio_core; extern crate tokio_io; @@ -29,7 +29,7 @@ extern crate tokio_io; use bytes::BytesMut; use futures::future::Future; use futures::{Sink, Stream}; -use libp2p_swarm::{Multiaddr, MuxedTransport, StreamMuxer, Transport}; +use libp2p_core::{Multiaddr, MuxedTransport, StreamMuxer, Transport}; use libp2p_tcp_transport::TcpConfig; use std::sync::{atomic, mpsc}; use std::thread; diff --git a/dns/Cargo.toml b/dns/Cargo.toml index 5eb8c3f2..bf62b19e 100644 --- a/dns/Cargo.toml +++ b/dns/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" futures = "0.1" multiaddr = "0.3.0" diff --git a/dns/src/lib.rs b/dns/src/lib.rs index 4408871d..17d692b7 100644 --- a/dns/src/lib.rs +++ b/dns/src/lib.rs @@ -37,7 +37,7 @@ //! extern crate futures; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; #[macro_use] extern crate log; extern crate multiaddr; diff --git a/example/Cargo.toml b/example/Cargo.toml index 328f6d8b..d35fb602 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -16,7 +16,7 @@ libp2p-floodsub = { path = "../floodsub" } libp2p-peerstore = { path = "../peerstore" } libp2p-ping = { path = "../ping" } libp2p-secio = { path = "../secio" } -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } libp2p-tcp-transport = { path = "../tcp-transport" } libp2p-websocket = { path = "../websocket" } rand = "0.4" diff --git a/example/examples/echo-dialer.rs b/example/examples/echo-dialer.rs index 49b1b130..9f047d67 100644 --- a/example/examples/echo-dialer.rs +++ b/example/examples/echo-dialer.rs @@ -23,7 +23,7 @@ extern crate env_logger; extern crate futures; extern crate libp2p_mplex as multiplex; extern crate libp2p_secio as secio; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate libp2p_websocket as websocket; extern crate tokio_core; diff --git a/example/examples/echo-server.rs b/example/examples/echo-server.rs index fcc7a672..f735d33a 100644 --- a/example/examples/echo-server.rs +++ b/example/examples/echo-server.rs @@ -23,7 +23,7 @@ extern crate env_logger; extern crate futures; extern crate libp2p_mplex as multiplex; extern crate libp2p_secio as secio; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate libp2p_websocket as websocket; extern crate tokio_core; diff --git a/example/examples/floodsub.rs b/example/examples/floodsub.rs index 58bba6df..eba699fb 100644 --- a/example/examples/floodsub.rs +++ b/example/examples/floodsub.rs @@ -25,7 +25,7 @@ extern crate libp2p_floodsub as floodsub; extern crate libp2p_mplex as multiplex; extern crate libp2p_peerstore as peerstore; extern crate libp2p_secio as secio; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate libp2p_websocket as websocket; extern crate rand; diff --git a/example/examples/kademlia.rs b/example/examples/kademlia.rs index f431f0db..5212993c 100644 --- a/example/examples/kademlia.rs +++ b/example/examples/kademlia.rs @@ -28,7 +28,7 @@ extern crate libp2p_kad as kad; extern crate libp2p_mplex as multiplex; extern crate libp2p_peerstore as peerstore; extern crate libp2p_secio as secio; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate tokio_core; extern crate tokio_io; diff --git a/example/examples/ping-client.rs b/example/examples/ping-client.rs index b8eede4a..2b64d565 100644 --- a/example/examples/ping-client.rs +++ b/example/examples/ping-client.rs @@ -24,7 +24,7 @@ extern crate futures; extern crate libp2p_mplex as multiplex; extern crate libp2p_ping as ping; extern crate libp2p_secio as secio; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate tokio_core; extern crate tokio_io; diff --git a/example/src/lib.rs b/example/src/lib.rs index cddc4c25..790445f4 100644 --- a/example/src/lib.rs +++ b/example/src/lib.rs @@ -19,7 +19,7 @@ // DEALINGS IN THE SOFTWARE. extern crate libp2p_peerstore; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate multiaddr; use libp2p_peerstore::{PeerAccess, PeerId, Peerstore}; diff --git a/floodsub/Cargo.toml b/floodsub/Cargo.toml index fd4481a5..ae36db91 100644 --- a/floodsub/Cargo.toml +++ b/floodsub/Cargo.toml @@ -10,7 +10,7 @@ bytes = "0.4" fnv = "1.0" futures = "0.1" libp2p-peerstore = { path = "../peerstore" } -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" multiaddr = "0.3" parking_lot = "0.5.3" diff --git a/floodsub/src/lib.rs b/floodsub/src/lib.rs index 0797588f..79801314 100644 --- a/floodsub/src/lib.rs +++ b/floodsub/src/lib.rs @@ -24,7 +24,7 @@ extern crate bytes; extern crate fnv; extern crate futures; extern crate libp2p_peerstore; -extern crate libp2p_swarm; +extern crate libp2p_core; #[macro_use] extern crate log; extern crate multiaddr; @@ -45,7 +45,7 @@ use fnv::{FnvHashMap, FnvHashSet, FnvHasher}; use futures::sync::mpsc; use futures::{future, Future, Poll, Sink, Stream}; use libp2p_peerstore::PeerId; -use libp2p_swarm::{ConnectionUpgrade, Endpoint}; +use libp2p_core::{ConnectionUpgrade, Endpoint}; use log::Level; use multiaddr::{AddrComponent, Multiaddr}; use parking_lot::{Mutex, RwLock}; diff --git a/identify/Cargo.toml b/identify/Cargo.toml index dc286b6d..daa6dd72 100644 --- a/identify/Cargo.toml +++ b/identify/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] bytes = "0.4" futures = "0.1" libp2p-peerstore = { path = "../peerstore" } -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" multiaddr = "0.3.0" protobuf = "=1.4.2" diff --git a/identify/src/lib.rs b/identify/src/lib.rs index fc46494a..a1362619 100644 --- a/identify/src/lib.rs +++ b/identify/src/lib.rs @@ -68,7 +68,7 @@ extern crate bytes; extern crate futures; extern crate libp2p_peerstore; -extern crate libp2p_swarm; +extern crate libp2p_core; #[macro_use] extern crate log; extern crate multiaddr; diff --git a/identify/src/protocol.rs b/identify/src/protocol.rs index 00b1d00d..20cd709b 100644 --- a/identify/src/protocol.rs +++ b/identify/src/protocol.rs @@ -20,7 +20,7 @@ use bytes::{Bytes, BytesMut}; use futures::{future, Future, Sink, Stream}; -use libp2p_swarm::{ConnectionUpgrade, Endpoint}; +use libp2p_core::{ConnectionUpgrade, Endpoint}; use log::Level; use multiaddr::Multiaddr; use protobuf::Message as ProtobufMessage; @@ -239,7 +239,7 @@ mod tests { use self::libp2p_tcp_transport::TcpConfig; use self::tokio_core::reactor::Core; use futures::{Future, Stream}; - use libp2p_swarm::Transport; + use libp2p_core::Transport; use std::sync::mpsc; use std::thread; use {IdentifyInfo, IdentifyOutput, IdentifyProtocolConfig}; diff --git a/identify/src/transport.rs b/identify/src/transport.rs index 76dc7380..58500e83 100644 --- a/identify/src/transport.rs +++ b/identify/src/transport.rs @@ -20,7 +20,7 @@ use futures::{future, stream, Future, IntoFuture, Stream}; use libp2p_peerstore::{PeerAccess, PeerId, Peerstore}; -use libp2p_swarm::{MuxedTransport, Transport}; +use libp2p_core::{MuxedTransport, Transport}; use multiaddr::{AddrComponent, Multiaddr}; use protocol::{IdentifyInfo, IdentifyOutput, IdentifyProtocolConfig}; use std::io::{Error as IoError, ErrorKind as IoErrorKind}; @@ -420,7 +420,7 @@ mod tests { use futures::{Future, Stream}; use libp2p_peerstore::memory_peerstore::MemoryPeerstore; use libp2p_peerstore::{PeerAccess, PeerId, Peerstore}; - use libp2p_swarm::Transport; + use libp2p_core::Transport; use multiaddr::{AddrComponent, Multiaddr}; use std::io::Error as IoError; use std::iter; diff --git a/kad/Cargo.toml b/kad/Cargo.toml index 1539fbc3..299a8c24 100644 --- a/kad/Cargo.toml +++ b/kad/Cargo.toml @@ -14,7 +14,7 @@ futures = "0.1" libp2p-identify = { path = "../identify" } libp2p-peerstore = { path = "../peerstore" } libp2p-ping = { path = "../ping" } -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4" multiaddr = "0.3" parking_lot = "0.5.1" diff --git a/kad/src/high_level.rs b/kad/src/high_level.rs index e7779f8e..5eb22885 100644 --- a/kad/src/high_level.rs +++ b/kad/src/high_level.rs @@ -29,7 +29,7 @@ use futures::{self, future, Future}; use kad_server::{KadServerInterface, KademliaServerConfig, KademliaServerController}; use kbucket::{KBucketsPeerId, KBucketsTable, UpdateOutcome}; use libp2p_peerstore::{PeerAccess, PeerId, Peerstore}; -use libp2p_swarm::{ConnectionUpgrade, Endpoint, MuxedTransport, SwarmController, Transport}; +use libp2p_core::{ConnectionUpgrade, Endpoint, MuxedTransport, SwarmController, Transport}; use multiaddr::Multiaddr; use parking_lot::Mutex; use protocol::ConnectionType; diff --git a/kad/src/kad_server.rs b/kad/src/kad_server.rs index 5f6487c8..eb5b6f72 100644 --- a/kad/src/kad_server.rs +++ b/kad/src/kad_server.rs @@ -39,8 +39,8 @@ use bytes::Bytes; use futures::sync::{mpsc, oneshot}; use futures::{future, Future, Sink, Stream}; use libp2p_peerstore::PeerId; -use libp2p_swarm::ConnectionUpgrade; -use libp2p_swarm::Endpoint; +use libp2p_core::ConnectionUpgrade; +use libp2p_core::Endpoint; use multiaddr::{AddrComponent, Multiaddr}; use protocol::{self, KadMsg, KademliaProtocolConfig, Peer}; use std::collections::VecDeque; diff --git a/kad/src/lib.rs b/kad/src/lib.rs index 13b1240e..75e65f63 100644 --- a/kad/src/lib.rs +++ b/kad/src/lib.rs @@ -71,7 +71,7 @@ extern crate futures; extern crate libp2p_identify; extern crate libp2p_peerstore; extern crate libp2p_ping; -extern crate libp2p_swarm; +extern crate libp2p_core; #[macro_use] extern crate log; extern crate multiaddr; diff --git a/kad/src/protocol.rs b/kad/src/protocol.rs index c6ea9f30..e969c740 100644 --- a/kad/src/protocol.rs +++ b/kad/src/protocol.rs @@ -29,7 +29,7 @@ use bytes::Bytes; use futures::future; use futures::{Sink, Stream}; use libp2p_peerstore::PeerId; -use libp2p_swarm::{ConnectionUpgrade, Endpoint, Multiaddr}; +use libp2p_core::{ConnectionUpgrade, Endpoint, Multiaddr}; use protobuf::{self, Message}; use protobuf_structs; use std::io::{Error as IoError, ErrorKind as IoErrorKind}; @@ -308,7 +308,7 @@ mod tests { use self::tokio_core::reactor::Core; use futures::{Future, Sink, Stream}; use libp2p_peerstore::PeerId; - use libp2p_swarm::Transport; + use libp2p_core::Transport; use protocol::{ConnectionType, KadMsg, KademliaProtocolConfig, Peer}; use std::sync::mpsc; use std::thread; diff --git a/mplex/Cargo.toml b/mplex/Cargo.toml index 2de246cc..e7648613 100644 --- a/mplex/Cargo.toml +++ b/mplex/Cargo.toml @@ -10,7 +10,7 @@ circular-buffer = { path = "../circular-buffer" } error-chain = "0.11.0" futures = "0.1" futures-mutex = { git = "https://github.com/paritytech/futures-mutex" } -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4" num-bigint = { version = "0.1.40", default-features = false } num-traits = "0.1.40" diff --git a/mplex/src/lib.rs b/mplex/src/lib.rs index d899437b..2df4dd52 100644 --- a/mplex/src/lib.rs +++ b/mplex/src/lib.rs @@ -25,7 +25,7 @@ extern crate circular_buffer; extern crate error_chain; extern crate futures; extern crate futures_mutex; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; #[macro_use] extern crate log; extern crate num_bigint; diff --git a/mplex/tests/two_peers.rs b/mplex/tests/two_peers.rs index 545c8789..97160de1 100644 --- a/mplex/tests/two_peers.rs +++ b/mplex/tests/two_peers.rs @@ -21,7 +21,7 @@ extern crate bytes; extern crate futures; extern crate libp2p_mplex as multiplex; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; extern crate libp2p_tcp_transport as tcp; extern crate tokio_core; extern crate tokio_io; diff --git a/ping/Cargo.toml b/ping/Cargo.toml index e2f03a35..6392a1a0 100644 --- a/ping/Cargo.toml +++ b/ping/Cargo.toml @@ -5,7 +5,7 @@ authors = ["pierre "] [dependencies] bytes = "0.4" -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" multiaddr = "0.3.0" multistream-select = { path = "../multistream-select" } diff --git a/ping/README.md b/ping/README.md index 8c122188..0f807a60 100644 --- a/ping/README.md +++ b/ping/README.md @@ -31,19 +31,19 @@ connections to non-responsive remotes. ```rust extern crate futures; extern crate libp2p_ping; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate tokio_core; use futures::Future; use libp2p_ping::Ping; -use libp2p_swarm::Transport; +use libp2p_core::Transport; let mut core = tokio_core::reactor::Core::new().unwrap(); let ping_finished_future = libp2p_tcp_transport::TcpConfig::new(core.handle()) .with_upgrade(Ping) - .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) + .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) .and_then(|((mut pinger, service), _)| { pinger.ping().map_err(|_| panic!()).select(service).map_err(|_| panic!()) }); diff --git a/ping/src/lib.rs b/ping/src/lib.rs index 665c9d32..8457dd14 100644 --- a/ping/src/lib.rs +++ b/ping/src/lib.rs @@ -54,20 +54,20 @@ //! ```no_run //! extern crate futures; //! extern crate libp2p_ping; -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_tcp_transport; //! extern crate tokio_core; //! //! use futures::Future; //! use libp2p_ping::Ping; -//! use libp2p_swarm::Transport; +//! use libp2p_core::Transport; //! //! # fn main() { //! let mut core = tokio_core::reactor::Core::new().unwrap(); //! //! let ping_finished_future = libp2p_tcp_transport::TcpConfig::new(core.handle()) //! .with_upgrade(Ping) -//! .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) +//! .dial("127.0.0.1:12345".parse::().unwrap()).unwrap_or_else(|_| panic!()) //! .and_then(|((mut pinger, service), _)| { //! pinger.ping().map_err(|_| panic!()).select(service).map_err(|_| panic!()) //! }); @@ -80,7 +80,7 @@ extern crate bytes; extern crate futures; -extern crate libp2p_swarm; +extern crate libp2p_core; #[macro_use] extern crate log; extern crate multistream_select; @@ -92,7 +92,7 @@ use bytes::{BufMut, Bytes, BytesMut}; use futures::future::{loop_fn, FutureResult, IntoFuture, Loop}; use futures::sync::{mpsc, oneshot}; use futures::{Future, Sink, Stream}; -use libp2p_swarm::{ConnectionUpgrade, Endpoint, Multiaddr}; +use libp2p_core::{ConnectionUpgrade, Endpoint, Multiaddr}; use log::Level; use parking_lot::Mutex; use rand::Rand; @@ -309,7 +309,7 @@ mod tests { use futures::Future; use futures::Stream; use futures::future::join_all; - use libp2p_swarm::{ConnectionUpgrade, Endpoint}; + use libp2p_core::{ConnectionUpgrade, Endpoint}; #[test] fn ping_pong() { diff --git a/ratelimit/Cargo.toml b/ratelimit/Cargo.toml index 92c0bac1..34068ade 100644 --- a/ratelimit/Cargo.toml +++ b/ratelimit/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] aio-limited = { git = "https://github.com/paritytech/aio-limited.git" } futures = "0.1" -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4" tokio = "0.1" tokio-io = "0.1" diff --git a/ratelimit/src/lib.rs b/ratelimit/src/lib.rs index 0786b052..74512a62 100644 --- a/ratelimit/src/lib.rs +++ b/ratelimit/src/lib.rs @@ -21,7 +21,7 @@ extern crate aio_limited; #[macro_use] extern crate futures; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; #[macro_use] extern crate log; extern crate tokio; diff --git a/secio/Cargo.toml b/secio/Cargo.toml index cebf11c5..51b79aa7 100644 --- a/secio/Cargo.toml +++ b/secio/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] bytes = "0.4" futures = "0.1" -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" protobuf = "=1.4.2" rand = "0.3.17" diff --git a/secio/README.md b/secio/README.md index 91dbc676..40ca6447 100644 --- a/secio/README.md +++ b/secio/README.md @@ -12,13 +12,13 @@ through it. extern crate futures; extern crate tokio_core; extern crate tokio_io; -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_secio; extern crate libp2p_tcp_transport; use futures::Future; use libp2p_secio::{SecioConfig, SecioKeyPair}; -use libp2p_swarm::{Multiaddr, Transport}; +use libp2p_core::{Multiaddr, Transport}; use libp2p_tcp_transport::TcpConfig; use tokio_core::reactor::Core; use tokio_io::io::write_all; diff --git a/secio/src/lib.rs b/secio/src/lib.rs index 349a7791..3c36fd04 100644 --- a/secio/src/lib.rs +++ b/secio/src/lib.rs @@ -32,14 +32,14 @@ //! extern crate futures; //! extern crate tokio_core; //! extern crate tokio_io; -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_secio; //! extern crate libp2p_tcp_transport; //! //! # fn main() { //! use futures::Future; //! use libp2p_secio::{SecioConfig, SecioKeyPair}; -//! use libp2p_swarm::{Multiaddr, Transport, upgrade}; +//! use libp2p_core::{Multiaddr, Transport, upgrade}; //! use libp2p_tcp_transport::TcpConfig; //! use tokio_core::reactor::Core; //! use tokio_io::io::write_all; @@ -84,7 +84,7 @@ extern crate bytes; extern crate crypto; extern crate futures; -extern crate libp2p_swarm; +extern crate libp2p_core; #[macro_use] extern crate log; extern crate protobuf; @@ -99,7 +99,7 @@ pub use self::error::SecioError; use bytes::{Bytes, BytesMut}; use futures::stream::MapErr as StreamMapErr; use futures::{Future, Poll, Sink, StartSend, Stream}; -use libp2p_swarm::Multiaddr; +use libp2p_core::Multiaddr; use ring::signature::RSAKeyPair; use rw_stream_sink::RwStreamSink; use std::error::Error; @@ -116,7 +116,7 @@ mod handshake; mod keys_proto; mod structs_proto; -/// Implementation of the `ConnectionUpgrade` trait of `libp2p_swarm`. Automatically applies +/// Implementation of the `ConnectionUpgrade` trait of `libp2p_core`. Automatically applies /// secio on any connection. #[derive(Clone)] pub struct SecioConfig { @@ -186,7 +186,7 @@ pub enum SecioPublicKey { Rsa(Vec), } -impl libp2p_swarm::ConnectionUpgrade for SecioConfig +impl libp2p_core::ConnectionUpgrade for SecioConfig where S: AsyncRead + AsyncWrite + 'static, { @@ -208,7 +208,7 @@ where self, incoming: S, _: (), - _: libp2p_swarm::Endpoint, + _: libp2p_core::Endpoint, remote_addr: &Multiaddr, ) -> Self::Future { info!(target: "libp2p-secio", "starting secio upgrade with {:?}", remote_addr); diff --git a/tcp-transport/Cargo.toml b/tcp-transport/Cargo.toml index 193f9290..d6f89848 100644 --- a/tcp-transport/Cargo.toml +++ b/tcp-transport/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } log = "0.4.1" futures = "0.1" multiaddr = "0.3.0" diff --git a/tcp-transport/src/lib.rs b/tcp-transport/src/lib.rs index 37eed216..22d4938c 100644 --- a/tcp-transport/src/lib.rs +++ b/tcp-transport/src/lib.rs @@ -50,7 +50,7 @@ //! documentation of `swarm` and of libp2p in general to learn how to use the `Transport` trait. extern crate futures; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; #[macro_use] extern crate log; extern crate multiaddr; diff --git a/websocket/Cargo.toml b/websocket/Cargo.toml index 7dec32ae..2dddfa5b 100644 --- a/websocket/Cargo.toml +++ b/websocket/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -libp2p-swarm = { path = "../swarm" } +libp2p-core = { path = "../core" } futures = "0.1" multiaddr = "0.3.0" log = "0.4.1" diff --git a/websocket/README.md b/websocket/README.md index 3f5f4e69..2db15a7d 100644 --- a/websocket/README.md +++ b/websocket/README.md @@ -30,12 +30,12 @@ This underlying transport must be put inside a `WsConfig` object through the `WsConfig::new()` function. ```rust -extern crate libp2p_swarm; +extern crate libp2p_core; extern crate libp2p_tcp_transport; extern crate libp2p_websocket; extern crate tokio_core; -use libp2p_swarm::{Multiaddr, Transport}; +use libp2p_core::{Multiaddr, Transport}; use libp2p_tcp_transport::TcpConfig; use libp2p_websocket::WsConfig; use tokio_core::reactor::Core; diff --git a/websocket/src/lib.rs b/websocket/src/lib.rs index 31dc2521..0a22e5c0 100644 --- a/websocket/src/lib.rs +++ b/websocket/src/lib.rs @@ -55,12 +55,12 @@ //! `WsConfig::new()` function. //! //! ``` -//! extern crate libp2p_swarm; +//! extern crate libp2p_core; //! extern crate libp2p_tcp_transport; //! extern crate libp2p_websocket; //! extern crate tokio_core; //! -//! use libp2p_swarm::{Multiaddr, Transport}; +//! use libp2p_core::{Multiaddr, Transport}; //! use libp2p_tcp_transport::TcpConfig; //! use libp2p_websocket::WsConfig; //! use tokio_core::reactor::Core; @@ -75,7 +75,7 @@ //! extern crate futures; -extern crate libp2p_swarm as swarm; +extern crate libp2p_core as swarm; #[macro_use] extern crate log; extern crate multiaddr;