Use libp2p 0.6.0 instead of a custom branch (#2150)

This commit is contained in:
Pierre Krieger
2019-03-30 17:53:20 -03:00
committed by André Silva
parent 63c3dd5a45
commit d4a4022dd1
5 changed files with 125 additions and 125 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ bytes = "0.4"
error-chain = { version = "0.12", default-features = false }
fnv = "1.0"
futures = "0.1"
libp2p = { git = "https://github.com/tomaka/libp2p-rs", branch = "substrate-tmp-2019-03-20", default-features = false, features = ["secio-secp256k1", "libp2p-websocket"] }
libp2p = { version = "0.6.0", default-features = false, features = ["secio-secp256k1", "libp2p-websocket"] }
parking_lot = "0.7.1"
lazy_static = "1.2"
log = "0.4"
@@ -63,11 +63,10 @@ impl<TMessage, TSubstream> Behaviour<TMessage, TSubstream> {
let custom_protocols = CustomProto::new(protocol, peerset);
let mut kademlia = Kademlia::without_init(local_public_key.into_peer_id());
let mut kademlia = Kademlia::new(local_public_key.into_peer_id());
for (peer_id, addr) in &known_addresses {
kademlia.add_connected_address(peer_id, addr.clone());
}
kademlia.initialize();
Behaviour {
ping: Ping::new(),
@@ -76,7 +75,7 @@ impl<TMessage, TSubstream> Behaviour<TMessage, TSubstream> {
user_defined: known_addresses,
kademlia,
next_kad_random_query: Delay::new(Instant::now()),
duration_to_next_kad: Duration::from_secs(10),
duration_to_next_kad: Duration::from_secs(1),
},
identify,
events: Vec::new(),