Skip to content

Commit

Permalink
feat: update to [email protected] (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire authored Oct 21, 2022
1 parent 93517a3 commit 8a906ee
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
resolver = "2"

[patch.crates-io]
libp2p = { git = "https://github.com/dignifiedquire/rust-libp2p", branch = "iroh-0-49" }
libp2p = { git = "https://github.com/dignifiedquire/rust-libp2p", branch = "iroh-0-50" }
# libp2p = { path = "../rust-libp2p" }

[profile.ci]
Expand Down
2 changes: 1 addition & 1 deletion iroh-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ anyhow = "1"
async-trait = "0.1.53"
tokio = { version = "1" }
bytes = "1.1.0"
libp2p = "0.49"
libp2p = "0.50"
tracing = "0.1.34"
futures = "0.3.21"
async-stream = "0.3.3"
Expand Down
4 changes: 2 additions & 2 deletions iroh-bitswap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tokio = { version = "1", features = ["sync"] }
bytes = "1.1.0"
cid = "0.8.0"
futures = "0.3.21"
libp2p = { version = "0.49", default-features = false, features = ["ping"] }
libp2p = { version = "0.50", default-features = false, features = ["ping"] }
multihash = "0.16.0"
prost = "0.11"
thiserror = "1.0.20"
Expand Down Expand Up @@ -48,7 +48,7 @@ deadqueue = "0.2.3"
[dev-dependencies]
criterion = "0.4.0"
tracing-subscriber = { version = "0.3.11", features = ["env-filter"] }
libp2p = { version = "0.49", features = ["yamux", "noise", "tcp-tokio"], default-features = false }
libp2p = { version = "0.50", features = ["yamux", "noise", "tcp", "tokio"], default-features = false }
tokio = { version = "1", features = ["macros", "net", "rt"] }
tokio-util = { version = "0.7", features = ["compat"] }

Expand Down
2 changes: 1 addition & 1 deletion iroh-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ opentelemetry = { version = "0.18.0", features = ["rt-tokio"] }
time = "0.3.9"
headers = "0.3.7"
hyper = "0.14.19"
libp2p = { version = "0.49", default-features = false }
libp2p = { version = "0.50", default-features = false }
iroh-util = { path = "../iroh-util" }
anyhow = "1"
futures = "0.3.21"
Expand Down
9 changes: 5 additions & 4 deletions iroh-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ console-subscriber = { version = "0.1.7", optional = true }
paste = "1.0.9"

[dependencies.libp2p]
version = "0.49"
version = "0.50"
default-features = false
features = [
"gossipsub",
"kad",
"identify",
"ping",
"mdns-tokio",
"mdns",
"noise",
"yamux",
"tcp-tokio",
"dns-tokio",
"tcp",
"dns",
"mplex",
"request-response",
"websocket",
Expand All @@ -51,6 +51,7 @@ features = [
"relay",
"dcutr",
"autonat",
"tokio",
]
optional = true

Expand Down
9 changes: 5 additions & 4 deletions iroh-p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ caches = "0.2.2"
tokio-stream = "0.1"

[dependencies.libp2p]
version = "0.49"
version = "0.50"
default-features = false
features = [
"gossipsub",
"kad",
"identify",
"ping",
"mdns-tokio",
"mdns",
"noise",
"yamux",
"tcp-tokio",
"dns-tokio",
"tcp",
"dns",
"mplex",
"request-response",
"websocket",
Expand All @@ -63,6 +63,7 @@ features = [
"dcutr",
"autonat",
"rsa",
"tokio",
]

[dependencies.multihash]
Expand Down
18 changes: 9 additions & 9 deletions iroh-p2p/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use iroh_bitswap::{Bitswap, Block, Config as BitswapConfig, Store};
use iroh_rpc_client::Client;
use libp2p::core::identity::Keypair;
use libp2p::core::PeerId;
use libp2p::gossipsub::{Gossipsub, GossipsubConfig, MessageAuthenticity};
use libp2p::identify::{Identify, IdentifyConfig};
use libp2p::gossipsub::{self, MessageAuthenticity};
use libp2p::identify;
use libp2p::kad::store::{MemoryStore, MemoryStoreConfig};
use libp2p::kad::{Kademlia, KademliaConfig};
use libp2p::mdns::TokioMdns as Mdns;
Expand All @@ -32,15 +32,15 @@ mod peer_manager;
#[behaviour(out_event = "Event", event_process = false)]
pub(crate) struct NodeBehaviour {
ping: Ping,
identify: Identify,
identify: identify::Behaviour,
pub(crate) bitswap: Toggle<Bitswap<BitswapStore>>,
pub(crate) kad: Toggle<Kademlia<MemoryStore>>,
mdns: Toggle<Mdns>,
pub(crate) autonat: Toggle<autonat::Behaviour>,
relay: Toggle<relay::v2::relay::Relay>,
relay_client: Toggle<relay::v2::client::Client>,
dcutr: Toggle<dcutr::behaviour::Behaviour>,
pub(crate) gossipsub: Toggle<Gossipsub>,
pub(crate) gossipsub: Toggle<gossipsub::Gossipsub>,
pub(crate) peer_manager: PeerManager,
}

Expand Down Expand Up @@ -99,7 +99,7 @@ impl NodeBehaviour {

let mdns = if config.mdns {
info!("init mdns");
Some(Mdns::new(Default::default()).await?)
Some(Mdns::new(Default::default())?)
} else {
None
}
Expand Down Expand Up @@ -183,18 +183,18 @@ impl NodeBehaviour {
};

let identify = {
let config = IdentifyConfig::new("ipfs/0.1.0".into(), local_key.public())
let config = identify::Config::new("ipfs/0.1.0".into(), local_key.public())
.with_agent_version(format!("iroh/{}", env!("CARGO_PKG_VERSION")))
.with_cache_size(64 * 1024);
Identify::new(config)
identify::Behaviour::new(config)
};

let gossipsub = if config.gossipsub {
info!("init gossipsub");
let gossipsub_config = GossipsubConfig::default();
let gossipsub_config = gossipsub::GossipsubConfig::default();
let message_authenticity = MessageAuthenticity::Signed(local_key.clone());
Some(
Gossipsub::new(message_authenticity, gossipsub_config)
gossipsub::Gossipsub::new(message_authenticity, gossipsub_config)
.map_err(|e| anyhow::anyhow!("{}", e))?,
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions iroh-p2p/src/behaviour/event.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use iroh_bitswap::BitswapEvent;
use libp2p::{
autonat, dcutr, gossipsub::GossipsubEvent, identify::IdentifyEvent, kad::KademliaEvent,
mdns::MdnsEvent, ping::Event as PingEvent, relay,
autonat, dcutr, gossipsub::GossipsubEvent, identify::Event as IdentifyEvent,
kad::KademliaEvent, mdns::MdnsEvent, ping::Event as PingEvent, relay,
};

use super::peer_manager::PeerManagerEvent;
Expand Down
10 changes: 5 additions & 5 deletions iroh-p2p/src/behaviour/peer_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use caches::{Cache, PutResult};
use iroh_metrics::{core::MRecorder, inc, p2p::P2PMetrics};
use libp2p::{
core::{connection::ConnectionId, transport::ListenerId, ConnectedPoint},
identify::IdentifyInfo,
identify::Info as IdentifyInfo,
ping::Success as PingSuccess,
swarm::{
handler::DummyConnectionHandler, ConnectionHandler, DialError, IntoConnectionHandler,
NetworkBehaviour, NetworkBehaviourAction, PollParameters,
dummy, ConnectionHandler, DialError, IntoConnectionHandler, NetworkBehaviour,
NetworkBehaviourAction, PollParameters,
},
Multiaddr, PeerId,
};
Expand Down Expand Up @@ -70,11 +70,11 @@ impl PeerManager {
}

impl NetworkBehaviour for PeerManager {
type ConnectionHandler = DummyConnectionHandler;
type ConnectionHandler = dummy::ConnectionHandler;
type OutEvent = PeerManagerEvent;

fn new_handler(&mut self) -> Self::ConnectionHandler {
DummyConnectionHandler::default()
dummy::ConnectionHandler
}

fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec<Multiaddr> {
Expand Down
2 changes: 1 addition & 1 deletion iroh-p2p/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use iroh_rpc_types::p2p::P2pServerAddr;
use libp2p::core::Multiaddr;
use libp2p::gossipsub::{GossipsubMessage, MessageId, TopicHash};
pub use libp2p::gossipsub::{IdentTopic, Topic};
use libp2p::identify::IdentifyEvent;
use libp2p::identify::Event as IdentifyEvent;
use libp2p::identity::Keypair;
use libp2p::kad::kbucket::{Distance, NodeStatus};
use libp2p::kad::BootstrapOk;
Expand Down
2 changes: 1 addition & 1 deletion iroh-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async-stream = "0.3.3"
fastmurmur3 = "0.1.2"
once_cell = "1.13.0"
tokio-util = { version = "0.7", features = ["io"] }
libp2p = { version = "0.49", default-features = false }
libp2p = { version = "0.50", default-features = false }
async-channel = "1.7.1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion iroh-rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tokio = { version = "1", features = ["sync"] }
prost = "0.11"
anyhow = "1.0.57"
bytes = "1.1.0"
libp2p = { version = "0.49", default-features = false, features = ["gossipsub"] }
libp2p = { version = "0.50", default-features = false, features = ["gossipsub"] }
iroh-metrics = { path = "../iroh-metrics", default-features = false }
tracing = "0.1.34"
toml = "0.5.9"
Expand Down
2 changes: 1 addition & 1 deletion iroh-share/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ iroh-resolver = { path = "../iroh-resolver", default-features = false, features
iroh-util = { path = "../iroh-util" }
tracing = "0.1.34"
tokio = { version = "1" }
libp2p = { version = "0.49", default-features = false, features = ["gossipsub"] }
libp2p = { version = "0.50", default-features = false, features = ["gossipsub"] }
serde = { version = "1", features = ["derive"] }
futures = "0.3.21"
bytes = "1.1.0"
Expand Down

0 comments on commit 8a906ee

Please sign in to comment.