More robust connections (#343)

* Make Kademlia connection more robust

* Make custom connetions more robust

* Fix potential deadlock

* Style and minor changes

* Upgrade rust-libp2p
This commit is contained in:
Pierre Krieger
2018-07-17 17:14:06 +02:00
committed by Gav Wood
parent 7372bbc0a5
commit 428682d3b5
5 changed files with 300 additions and 351 deletions
+184 -136
View File
@@ -16,7 +16,7 @@ dependencies = [
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -252,17 +252,17 @@ dependencies = [
[[package]]
name = "cid"
version = "0.2.3"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"multibase 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "circular-buffer"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"smallvec 0.6.0 (git+https://github.com/Vurich/rust-smallvec.git?branch=array-zero)",
]
@@ -409,7 +409,7 @@ dependencies = [
[[package]]
name = "datastore"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"chashmap 2.2.1 (git+https://github.com/redox-os/tfs)",
@@ -925,7 +925,7 @@ dependencies = [
"relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1039,7 +1039,7 @@ dependencies = [
"jsonrpc-core 8.0.2 (git+https://github.com/paritytech/jsonrpc.git)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1148,158 +1148,160 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libp2p"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-core"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bs58 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-dns"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"tokio-dns-unofficial 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-floodsub"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bs58 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "libp2p-identify"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf-codegen-pure 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "libp2p-kad"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"bigint 4.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bs58 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "libp2p-mplex"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"circular-buffer 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"circular-buffer 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"futures-mutex 0.3.0 (git+https://github.com/paritytech/futures-mutex)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "libp2p-peerstore"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bs58 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1308,90 +1310,90 @@ dependencies = [
[[package]]
name = "libp2p-ping"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-ratelimit"
version = "0.1.1"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-relay"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"protobuf 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
name = "libp2p-secio"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"asn1_der 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf-codegen-pure 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
"rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-tcp-transport"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-transport-timeout"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1399,18 +1401,31 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"websocket 0.20.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libp2p-yamux"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"yamux 0.1.0 (git+https://github.com/paritytech/yamux)",
]
[[package]]
name = "linked-hash-map"
version = "0.5.1"
@@ -1541,10 +1556,10 @@ dependencies = [
[[package]]
name = "multiaddr"
version = "0.3.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cid 0.2.3 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"cid 0.2.3 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"integer-encoding 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1559,7 +1574,7 @@ dependencies = [
[[package]]
name = "multihash"
version = "0.8.1-pre"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1569,14 +1584,14 @@ dependencies = [
[[package]]
name = "multistream-select"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
]
[[package]]
@@ -2121,6 +2136,11 @@ dependencies = [
"parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quick-error"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quick-error"
version = "1.2.2"
@@ -2357,11 +2377,11 @@ dependencies = [
[[package]]
name = "rw-stream-sink"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2785,12 +2805,12 @@ dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)",
"libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)",
"libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"varint 0.1.0 (git+https://github.com/libp2p/rust-libp2p)",
]
@@ -3318,7 +3338,7 @@ dependencies = [
"mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-fs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-threadpool 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3326,6 +3346,16 @@ dependencies = [
"tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-codec"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-core"
version = "0.1.17"
@@ -3339,7 +3369,7 @@ dependencies = [
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3369,13 +3399,13 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-threadpool 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tokio-io"
version = "0.1.6"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3396,7 +3426,7 @@ dependencies = [
"smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3410,7 +3440,7 @@ dependencies = [
"mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -3430,7 +3460,7 @@ dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3464,7 +3494,7 @@ dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -3476,7 +3506,7 @@ dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -3652,20 +3682,20 @@ dependencies = [
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "varint"
version = "0.1.0"
source = "git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc#77b1c445807e53b8c5e4e5e2da751222da15b8cc"
source = "git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0#2fb5ef1d40f2565e592248abbd21b7ca2da992e0"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -3744,7 +3774,7 @@ dependencies = [
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3814,6 +3844,20 @@ name = "yaml-rust"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "yamux"
version = "0.1.0"
source = "git+https://github.com/paritytech/yamux#b2104369a4f676e11d1fc86cfc33e9a68d21c4f3"
dependencies = [
"bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
"checksum aio-limited 0.1.0 (git+https://github.com/paritytech/aio-limited.git)" = "<none>"
@@ -3848,8 +3892,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18"
"checksum chashmap 2.2.1 (git+https://github.com/redox-os/tfs)" = "<none>"
"checksum chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce36c92cb605414e9b824f866f5babe0a0368e39ea07393b9b63cf3844c0e6"
"checksum cid 0.2.3 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum circular-buffer 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum cid 0.2.3 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum circular-buffer 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3"
@@ -3866,7 +3910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b"
"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda"
"checksum ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)" = "<none>"
"checksum datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum datastore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8"
"checksum digest 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3cae2388d706b52f2f2f9afe280f9d768be36544bd71d1b8120cb34ea6450b55"
"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
@@ -3937,21 +3981,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206"
"checksum libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum libp2p 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-core 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-dns 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-floodsub 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-identify 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-kad 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-mplex 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-peerstore 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-ping 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-ratelimit 0.1.1 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-relay 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-secio 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-tcp-transport 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-transport-timeout 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-websocket 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum libp2p-yamux 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
"checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66"
"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
@@ -3967,10 +4012,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum mime 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0b28683d0b09bbc20be1c9b3f6f24854efb1356ffcffee08ea3f6e65596e85fa"
"checksum mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "6d771e3ef92d58a8da8df7d6976bfca9371ed1de6619d9d5a5ce5b1f29b85bfe"
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum multiaddr 0.3.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum multibase 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9c35dac080fd6e16a99924c8dfdef0af89d797dd851adab25feaffacf7850d6"
"checksum multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum multihash 0.8.1-pre (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum multistream-select 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f"
"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0"
"checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0"
@@ -4004,6 +4049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum protobuf-codegen-pure 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7fcc3085b0644bcad72ea33f174f267c24e558e56a97115e3ef31a4483581a1b"
"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07"
"checksum pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd695333cfae6e9dbe2703a6d040e252b57a6fc3b9a65c712615ac042b2e0c5"
"checksum quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb6ccf8db7bbcb9c2eae558db5ab4f3da1c2a87e4e597ed394726bc8ea6ca1d"
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
@@ -4031,7 +4077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)" = "<none>"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a"
"checksum rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum rw-stream-sink 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
"checksum schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "85fd9df495640643ad2d00443b3d78aae69802ad488debab4f1dd52fc1806ade"
"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
@@ -4076,11 +4122,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum timer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b"
"checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f"
"checksum tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ee337e5f4e501fc32966fec6fe0ca0cc1c237b0b1b14a335f8bfe3c5f06e286"
"checksum tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "881e9645b81c2ce95fcb799ded2c29ffb9f25ef5bef909089a420e5961dd8ccb"
"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71"
"checksum tokio-dns-unofficial 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "be509b88bef660929f3066a6ed30260f8c1f3035c5ac80a7c67bb39c9cf28376"
"checksum tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cac2a7883ff3567e9d66bb09100d09b33d90311feca0206c7ca034bc0c55113"
"checksum tokio-fs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76766830bbf9a2d5bfb50c95350d56a2e79e2c80f675967fff448bc615899708"
"checksum tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af9eb326f64b2d6b68438e1953341e00ab3cf54de7e35d92bfc73af8555313a"
"checksum tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a5c9635ee806f26d302b8baa1e145689a280d8f5aa8d0552e7344808da54cc21"
"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
"checksum tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3cedc8e5af5131dc3423ffa4f877cce78ad25259a9a62de0613735a13ebc64b"
"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
@@ -4112,7 +4159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
"checksum varint 0.1.0 (git+https://github.com/libp2p/rust-libp2p)" = "<none>"
"checksum varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=77b1c445807e53b8c5e4e5e2da751222da15b8cc)" = "<none>"
"checksum varint 0.1.0 (git+https://github.com/tomaka/libp2p-rs?rev=2fb5ef1d40f2565e592248abbd21b7ca2da992e0)" = "<none>"
"checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"
@@ -4131,3 +4178,4 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
"checksum yamux 0.1.0 (git+https://github.com/paritytech/yamux)" = "<none>"
@@ -11,7 +11,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", rev = "77b1c445807e53b8c5e4e5e2da751222da15b8cc", default-features = false, features = ["libp2p-secio", "libp2p-secio-secp256k1"] }
libp2p = { git = "https://github.com/tomaka/libp2p-rs", rev = "2fb5ef1d40f2565e592248abbd21b7ca2da992e0", default-features = false, features = ["libp2p-secio", "libp2p-secio-secp256k1"] }
ethcore-io = { git = "https://github.com/paritytech/parity.git" }
ethkey = { git = "https://github.com/paritytech/parity.git" }
ethereum-types = "0.3"
@@ -55,8 +55,7 @@ pub struct RegisteredProtocolOutput<T> {
/// Version of the protocol that was negotiated.
pub protocol_version: u8,
/// Channel to sender outgoing messages to. Closing this channel closes the
/// connection.
/// Channel to sender outgoing messages to.
// TODO: consider assembling packet_id here
pub outgoing: mpsc::UnboundedSender<Bytes>,
@@ -156,7 +155,6 @@ where C: AsyncRead + AsyncWrite + 'static, // TODO: 'static :-/
let (sink, stream) = {
let framed = AsyncRead::framed(socket, VarintCodec::default());
let msg_rx = msg_rx.map(Message::SendReq)
.chain(stream::once(Ok(Message::Finished)))
.map_err(|()| unreachable!("mpsc::UnboundedReceiver never errors"));
let (sink, stream) = framed.split();
let stream = stream.map(Message::RecvSocket)
@@ -16,8 +16,8 @@
use bytes::Bytes;
use fnv::{FnvHashMap, FnvHashSet};
use futures::{future, Future, Stream, sync::mpsc};
use libp2p::core::{Multiaddr, AddrComponent, Endpoint};
use futures::{future, sync::mpsc};
use libp2p::core::{Multiaddr, AddrComponent, Endpoint, UniqueConnec};
use libp2p::core::{PeerId as PeerstorePeerId, PublicKey};
use libp2p::kad::KadConnecController;
use libp2p::peerstore::{Peerstore, PeerAccess};
@@ -90,26 +90,14 @@ struct Connections {
}
struct PeerConnectionInfo {
/// A list of message senders per protocol, and the protocol version.
/// A list of protocols, and the potential corresponding connection.
/// The `UniqueConnec` contains a sender and the protocol version.
/// The sender can be used to transmit data for the remote. Note that the
/// packet_id has to be inside the `Bytes`.
/// Closing the sender will drop the substream of this protocol.
senders: Vec<(ProtocolId, mpsc::UnboundedSender<Bytes>, u8)>,
/// True if we dialed a Kad connection towards this peer.
/// This indicates that `kad_connec` should eventually resolve, even
/// without doing anything.
opened_kad: bool,
/// When a Kad connection is received, we send it on this channel so that
/// it will be received by `kad_connec`.
incoming_kad_channel: mpsc::UnboundedSender<KadConnecController>,
protocols: Vec<(ProtocolId, UniqueConnec<(mpsc::UnboundedSender<Bytes>, u8)>)>,
/// The Kademlia connection to this node.
/// Contains the receiving end of `incoming_kad_channel`. If `opened_kad`
/// is true, we are guaranteed to finish.
/// TODO: proper error handling if a kad connection is closed
kad_connec: future::Shared<Box<Future<Item = KadConnecController, Error = IoError>>>,
kad_connec: UniqueConnec<KadConnecController>,
/// Id of the peer.
id: PeerstorePeerId,
@@ -257,8 +245,13 @@ impl NetworkState {
None => return None,
};
let protocol_version = match info.senders.iter().find(|&(ref p, _, _)| p == &protocol) {
Some(&(_, _, version)) => version as u32,
let protocol_version = match info.protocols.iter().find(|&(ref p, _)| p == &protocol) {
Some(&(_, ref unique_connec)) =>
if let Some(val) = unique_connec.poll() {
val.1 as u32
} else {
return None
}
None => return None,
};
@@ -289,7 +282,10 @@ impl NetworkState {
None => return None,
};
peer.senders.iter().find(|p| p.0 == protocol).map(|p| p.2)
peer.protocols.iter()
.find(|p| p.0 == protocol)
.and_then(|p| p.1.poll())
.map(|(_, version)| version)
}
/// Equivalent to `session_info(peer).map(|info| info.client_version)`.
@@ -419,24 +415,11 @@ impl NetworkState {
connections.peer_by_nodeid.contains_key(node_id)
}
/// Returns true if we are connected to the given node with the given protocol.
pub fn has_protocol_connection(&self, node_id: &PeerstorePeerId,
protocol_id: ProtocolId) -> bool {
let connections = self.connections.read();
if let Some(peer) = connections.peer_by_nodeid.get(node_id) {
let info = match connections.info_by_peer.get(&peer) {
Some(peer) => peer,
None => return false,
};
info.senders.iter().any(|p| p.0 == protocol_id)
} else {
false
}
}
/// Call this when a Kademlia connection has been opened from a remote.
pub fn incoming_kad_connection(&self, node_id: PeerstorePeerId,
ctrl: KadConnecController) -> Result<PeerId, IoError> {
/// Obtains the `UniqueConnec` corresponding to the Kademlia connect to a peer.
pub fn kad_connection(
&self,
node_id: PeerstorePeerId
) -> Result<(PeerId, UniqueConnec<KadConnecController>), IoError> {
// TODO: check that the peer is disabled? should disabling a peer also prevent
// kad from working?
let mut connections = self.connections.write();
@@ -444,61 +427,8 @@ impl NetworkState {
node_id, Endpoint::Listener)?;
let infos = connections.info_by_peer.get_mut(&peer_id)
.expect("Newly-created peer id is always valid");
let _ = infos.incoming_kad_channel.unbounded_send(ctrl);
Ok(peer_id)
}
/// Obtain a Kademlia connection to the given peer.
pub fn obtain_kad_connection<F, Fut>(&self, node_id: PeerstorePeerId, opener: F)
-> Result<(PeerId, impl Future<Item = KadConnecController, Error = IoError>), IoError>
where F: FnOnce() -> Fut, Fut: Future<Item = KadConnecController, Error = IoError>
{
let mut connections = self.connections.write();
let peer_id = accept_connection(&mut connections, &self.next_peer_id,
node_id, Endpoint::Dialer)?;
let infos = connections.info_by_peer.get_mut(&peer_id)
.expect("Newly-created peer id is always valid");
let future_to_process = if !infos.opened_kad {
let tx = infos.incoming_kad_channel.clone();
let new_kad = opener().and_then(move |ctrl| {
tx.unbounded_send(ctrl.clone())
.map_err(|err| IoError::new(IoErrorKind::ConnectionAborted, err))?;
Ok(ctrl)
});
infos.opened_kad = true;
future::Either::A(new_kad)
} else {
future::Either::B(future::empty())
};
let fut = infos.kad_connec
.clone()
.map(|ctrl| (*ctrl).clone())
.map_err(|err| IoError::new(IoErrorKind::ConnectionAborted, err))
.select(future_to_process)
.map(|(item, _)| item)
.map_err(|(err, _)| err);
Ok((peer_id, fut))
}
/// Disconnect the Kademlia controller with the peer.
pub fn disconnect_kademlia(&self, peer_id: PeerId) {
let mut connections = self.connections.write();
if let Some(peer) = connections.info_by_peer.get_mut(&peer_id) {
// TODO: that's code duplication
let (tx, rx) = mpsc::unbounded();
let rx = rx.into_future()
.map_err(|_| -> IoError { unreachable!("an `UnboundedReceiver` can never produce an error") })
.and_then(|i| i.0.ok_or(IoError::new(
IoErrorKind::ConnectionAborted, "kad aborted")));
let kad_connec = Box::new(rx) as Box<Future<Item = _, Error = _>>;
peer.incoming_kad_channel = tx;
peer.kad_connec = kad_connec.shared();
peer.opened_kad = false;
}
let connec = infos.kad_connec.clone();
Ok((peer_id, connec))
}
/// Try to add a new connection to a node in the list.
@@ -513,14 +443,12 @@ impl NetworkState {
///
/// The various methods of the `NetworkState` that close a connection do
/// so by dropping this sender.
pub fn accept_custom_proto(
pub fn custom_proto(
&self,
node_id: PeerstorePeerId,
protocol_id: ProtocolId,
protocol_version: u8,
endpoint: Endpoint,
msg_tx: mpsc::UnboundedSender<Bytes>
) -> Result<PeerId, IoError> {
) -> Result<(PeerId, UniqueConnec<(mpsc::UnboundedSender<Bytes>, u8)>), IoError> {
let mut connections = self.connections.write();
if is_peer_disabled(&self.disabled_peers, &node_id) {
@@ -551,20 +479,23 @@ impl NetworkState {
}
}
if !infos.senders.iter().any(|&(prot, _, _)| prot == protocol_id) {
infos.senders.push((protocol_id.clone(), msg_tx, protocol_version));
if let Some((_, ref uconn)) = infos.protocols.iter().find(|&(prot, _)| prot == &protocol_id) {
return Ok((peer_id, uconn.clone()))
}
Ok(peer_id)
let unique_connec = UniqueConnec::empty();
infos.protocols.push((protocol_id.clone(), unique_connec.clone()));
Ok((peer_id, unique_connec))
}
/// Sends some data to the given peer, using the sender that was passed
/// to `accept_custom_proto`.
/// to the `UniqueConnec` of `custom_proto`.
pub fn send(&self, protocol: ProtocolId, peer_id: PeerId, message: Bytes)
-> Result<(), Error> {
if let Some(peer) = self.connections.read().info_by_peer.get(&peer_id) {
let sender = peer.senders.iter().find(|elem| elem.0 == protocol)
.map(|e| &e.1);
let sender = peer.protocols.iter().find(|elem| elem.0 == protocol)
.and_then(|e| e.1.poll())
.map(|e| e.0);
if let Some(sender) = sender {
sender.unbounded_send(message)
.map_err(|err| ErrorKind::Io(IoError::new(IoErrorKind::Other, err)))?;
@@ -585,7 +516,8 @@ impl NetworkState {
}
/// Disconnects a peer, if a connection exists (ie. drops the Kademlia
/// controller, and the senders that were passed to `accept_custom_proto`).
/// controller, and the senders that were stored in the `UniqueConnec` of
/// `custom_proto`).
pub fn disconnect_peer(&self, peer_id: PeerId) {
let mut connections = self.connections.write();
if let Some(peer_info) = connections.info_by_peer.remove(&peer_id) {
@@ -596,7 +528,7 @@ impl NetworkState {
/// Disconnects all the peers.
/// This destroys all the Kademlia controllers and the senders that were
/// passed to `accept_custom_proto`.
/// stored in the `UniqueConnec` of `custom_proto`.
pub fn disconnect_all(&self) {
let mut connec = self.connections.write();
*connec = Connections {
@@ -609,8 +541,8 @@ impl NetworkState {
/// Disables a peer for `PEER_DISABLE_DURATION`. This adds the peer to the
/// list of disabled peers, and drops any existing connections if
/// necessary (ie. drops the sender that was passed to
/// `accept_custom_proto`).
/// necessary (ie. drops the sender that was stored in the `UniqueConnec`
/// of `custom_proto`).
pub fn disable_peer(&self, peer_id: PeerId, reason: &str) {
// TODO: what do we do if the peer is reserved?
let mut connections = self.connections.write();
@@ -683,18 +615,9 @@ fn accept_connection(
let peer_id = *peer_by_nodeid.entry(node_id.clone()).or_insert_with(|| {
let new_id = next_peer_id.fetch_add(1, atomic::Ordering::Relaxed);
let (tx, rx) = mpsc::unbounded();
let rx = rx
.into_future()
.map_err(|_| -> IoError { unreachable!("an `UnboundedReceiver` can never produce an error") })
.and_then(|i| i.0.ok_or(IoError::new(IoErrorKind::ConnectionAborted, "kad aborted")));
let kad_connec = Box::new(rx) as Box<Future<Item = _, Error = _>>;
info_by_peer.insert(new_id, PeerConnectionInfo {
senders: Vec::new(), // TODO: Vec::with_capacity(num_registered_protocols),
opened_kad: false,
incoming_kad_channel: tx,
kad_connec: kad_connec.shared(),
protocols: Vec::new(), // TODO: Vec::with_capacity(num_registered_protocols),
kad_connec: UniqueConnec::empty(),
id: node_id.clone(),
originated: endpoint == Endpoint::Dialer,
ping: Mutex::new(None),
@@ -868,22 +791,18 @@ mod tests {
let state = NetworkState::new(&Default::default()).unwrap();
let example_peer = PublicKey::Rsa(vec![1, 2, 3, 4]).into_peer_id();
let peer_id = state.accept_custom_proto(
let (peer_id, _) = state.custom_proto(
example_peer.clone(),
[1, 2, 3],
1,
Endpoint::Dialer,
mpsc::unbounded().0
Endpoint::Dialer
).unwrap();
state.disable_peer(peer_id, "Just a test");
assert!(state.accept_custom_proto(
assert!(state.custom_proto(
example_peer.clone(),
[1, 2, 3],
1,
Endpoint::Dialer,
mpsc::unbounded().0
Endpoint::Dialer
).is_err());
}
}
@@ -586,16 +586,9 @@ fn handle_kademlia_connection(
controller: KadConnecController,
kademlia_stream: Box<Stream<Item = KadIncomingRequest, Error = IoError>>
) -> Result<impl Future<Item = (), Error = IoError>, IoError> {
// We add the Kademlia controller to the network state, and use a guard to remove
// it later.
struct KadDisconnectGuard(Arc<Shared>, PeerId);
impl Drop for KadDisconnectGuard {
fn drop(&mut self) { self.0.network_state.disconnect_kademlia(self.1); }
}
let node_id = p2p_multiaddr_to_node_id(client_addr);
let peer_id = shared.network_state.incoming_kad_connection(node_id.clone(), controller)?;
let kad_live_guard = KadDisconnectGuard(shared.clone(), peer_id);
let (_peer_id, kad_connec) = shared.network_state
.kad_connection(node_id.clone())?;
let future = kademlia_stream.for_each({
let shared = shared.clone();
@@ -609,13 +602,9 @@ fn handle_kademlia_connection(
}
Ok(())
}
}).then(move |val| {
// Makes sure that `kad_live_guard` is kept alive until here.
drop(kad_live_guard);
val
});
Ok(future)
Ok(kad_connec.set_until(controller, future))
}
/// When a remote performs a `FIND_NODE` Kademlia request for `searched`,
@@ -673,27 +662,16 @@ fn handle_custom_connection(
// TODO: is there a better way to refuse connections than to drop the
// newly-opened substream? should we refuse the connection
// beforehand?
let peer_id = match shared.network_state.accept_custom_proto(
let (peer_id, unique_connec) = match shared.network_state.custom_proto(
node_id.clone(),
protocol_id,
custom_proto_out.protocol_version,
endpoint,
custom_proto_out.outgoing
) {
Ok(peer_id) => peer_id,
Ok(a) => a,
Err(err) => return future::Either::A(future::err(err.into())),
};
debug!(target: "sub-libp2p", "Successfully connected to {:?} (peer id \
{}) with protocol {:?} version {}", node_id, peer_id, protocol_id,
custom_proto_out.protocol_version);
handler.connected(&NetworkContextImpl {
inner: shared.clone(),
protocol: protocol_id,
current_peer: Some(peer_id),
}, &peer_id);
struct KadDisconnectGuard {
struct ProtoDisconnectGuard {
inner: Arc<Shared>,
peer_id: PeerId,
node_id: PeerstorePeerId,
@@ -701,7 +679,7 @@ fn handle_custom_connection(
protocol: ProtocolId
}
impl Drop for KadDisconnectGuard {
impl Drop for ProtoDisconnectGuard {
fn drop(&mut self) {
debug!(target: "sub-libp2p", "Node {:?} with peer ID {} \
through protocol {:?} disconnected", self.node_id, self.peer_id,
@@ -718,7 +696,7 @@ fn handle_custom_connection(
}
}
let dc_guard = KadDisconnectGuard {
let dc_guard = ProtoDisconnectGuard {
inner: shared.clone(),
peer_id,
node_id: node_id.clone(),
@@ -726,22 +704,41 @@ fn handle_custom_connection(
protocol: protocol_id,
};
future::Either::B(custom_proto_out
.incoming
.for_each(move |(packet_id, data)| {
shared.kad_system.update_kbuckets(node_id.clone());
handler.read(&NetworkContextImpl {
inner: shared.clone(),
protocol: protocol_id,
current_peer: Some(peer_id.clone()),
}, &peer_id, packet_id, &data);
Ok(())
})
let fut = custom_proto_out.incoming
.for_each({
let shared = shared.clone();
let handler = handler.clone();
let node_id = node_id.clone();
move |(packet_id, data)| {
shared.kad_system.update_kbuckets(node_id.clone());
handler.read(&NetworkContextImpl {
inner: shared.clone(),
protocol: protocol_id,
current_peer: Some(peer_id.clone()),
}, &peer_id, packet_id, &data);
Ok(())
}
});
let val = (custom_proto_out.outgoing, custom_proto_out.protocol_version);
let final_fut = unique_connec.set_until(val, fut)
.then(move |val| {
// Makes sure that `dc_guard` is kept alive until here.
drop(dc_guard);
val
}))
});
debug!(target: "sub-libp2p", "Successfully connected to {:?} (peer id \
{}) with protocol {:?} version {}", node_id, peer_id, protocol_id,
custom_proto_out.protocol_version);
handler.connected(&NetworkContextImpl {
inner: shared.clone(),
protocol: protocol_id,
current_peer: Some(peer_id),
}, &peer_id);
future::Either::B(final_fut)
}
/// Builds the multiaddress corresponding to the address we need to listen to
@@ -906,35 +903,30 @@ fn process_kad_results<T, To, St, C>(shared: Arc<Shared>, transport: T,
let addr: Multiaddr = AddrComponent::P2P(discovered_peer.clone().into_bytes()).into();
trace!(target: "sub-libp2p", "Dialing discovered node {:?} for each protocol", addr);
for proto in shared.protocols.read().0.clone().into_iter() {
if shared.network_state.has_protocol_connection(&discovered_peer, proto.id()) {
continue
}
// TODO: check that the secio key matches the id given by kademlia
if let Err(err) = dial_peer_custom_proto(
open_peer_custom_proto(
shared.clone(),
transport.clone(),
proto, addr.clone(),
proto,
addr.clone(),
discovered_peer.clone(),
&swarm_controller
) {
warn!(target: "sub-libp2p", "Error while dialing {}: {:?}", addr, err);
}
);
}
}
}
/// Dials the given address for the given protocol and using the
/// given `swarm_controller`.
/// If necessary, dials the given address for the given protocol and using the
/// given `swarm_controller`. Has no effect if we already dialed earlier.
/// Checks that the peer ID matches `expected_peer_id`.
fn dial_peer_custom_proto<T, To, St, C>(
// TODO: check that the secio key matches the id given by kademlia
fn open_peer_custom_proto<T, To, St, C>(
shared: Arc<Shared>,
base_transport: T,
proto: RegisteredProtocol<Arc<NetworkProtocolHandler + Send + Sync>>,
addr: Multiaddr,
expected_peer_id: PeerstorePeerId,
swarm_controller: &SwarmController<St>
) -> Result<(), IoError>
)
where T: MuxedTransport<Output = TransportOutput<To>> + Clone + 'static,
T::MultiaddrFuture: 'static,
To: AsyncRead + AsyncWrite + 'static,
@@ -942,6 +934,8 @@ fn dial_peer_custom_proto<T, To, St, C>(
C: 'static,
{
let proto_id = proto.id();
let peer_id = expected_peer_id.clone();
let shared2 = shared.clone();
// TODO: check that the secio key matches the id given by kademlia
let with_proto = base_transport
@@ -971,8 +965,10 @@ fn dial_peer_custom_proto<T, To, St, C>(
future::ok(((FinalUpgrade::Custom(out), endpoint), client_addr))
);
swarm_controller.dial(addr, with_proto)
.map_err(|_| IoError::new(IoErrorKind::Other, "multiaddr not supported"))
if let Ok(unique_connec) = shared2.network_state
.custom_proto(peer_id, proto_id, Endpoint::Dialer) {
let _ = unique_connec.1.get_or_dial(&swarm_controller, &addr, with_proto);
}
}
/// Obtain a Kademlia connection to the given peer.
@@ -985,33 +981,21 @@ fn obtain_kad_connection<T, To, St, C>(shared: Arc<Shared>,
St: MuxedTransport<Output = (FinalUpgrade<C>, Endpoint)> + Clone + 'static,
C: 'static {
let kad_upgrade = shared.kad_upgrade.clone();
let final_future = shared.network_state
.obtain_kad_connection(peer_id.clone(), move || {
let addr: Multiaddr = AddrComponent::P2P(peer_id.clone().into_bytes()).into();
trace!(target: "sub-libp2p", "Opening new kademlia connection to {}", addr);
let (tx, rx) = oneshot::channel();
let tx = Arc::new(Mutex::new(Some(tx)));
swarm_controller.dial(addr,
transport
.and_then(move |out, endpoint, client_addr|
upgrade::apply(out.socket, kad_upgrade.clone(),
endpoint, client_addr)
)
.map(move |(kad_ctrl, stream), _| {
if let Some(tx) = tx.lock().take() {
let _ = tx.send(kad_ctrl.clone());
}
(FinalUpgrade::Kad((kad_ctrl, stream)), Endpoint::Dialer)
})
)
.expect("cannot dial");
rx.map_err(|err| IoError::new(IoErrorKind::ConnectionAborted, err))
})
let addr: Multiaddr = AddrComponent::P2P(peer_id.clone().into_bytes()).into();
let transport = transport
.and_then(move |out, endpoint, client_addr|
upgrade::apply(out.socket, kad_upgrade.clone(),
endpoint, client_addr)
)
.map(move |(kad_ctrl, stream), _|
(FinalUpgrade::Kad((kad_ctrl, stream)), Endpoint::Dialer)
);
shared.network_state
.kad_connection(peer_id.clone())
.into_future()
.and_then(|(_peer_id, kad_ctrl)| kad_ctrl);
// Note that we use a Box in order to speed compilation time.
Box::new(final_future) as Box<Future<Item = _, Error = _>>
.map(move |(_, k)| k.get_or_dial(&swarm_controller, &addr, transport))
.flatten()
}
/// Processes the information about a node.