chore: most of the libp2p updating, comment out mdns

not a nice thing to do but there remains an issue with the dependencies,
and the libp2p tokio-mdns feature is gone. there are also some conflicts
remaining.
This commit is contained in:
Joonas Koivunen 2021-01-13 11:30:00 +02:00
parent 66c360cd13
commit 2e0b436172
10 changed files with 406 additions and 191 deletions

538
Cargo.lock generated
View File

@ -100,6 +100,26 @@ dependencies = [
"syn",
]
[[package]]
name = "async-io"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd"
dependencies = [
"concurrent-queue",
"fastrand",
"futures-lite",
"libc",
"log",
"nb-connect",
"once_cell",
"parking",
"polling",
"vec-arena",
"waker-fn",
"winapi 0.3.9",
]
[[package]]
name = "async-stream"
version = "0.3.0"
@ -132,6 +152,19 @@ dependencies = [
"syn",
]
[[package]]
name = "asynchronous-codec"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6"
dependencies = [
"bytes 1.0.1",
"futures-sink",
"futures-util",
"memchr",
"pin-project-lite 0.2.4",
]
[[package]]
name = "atomic"
version = "0.5.0"
@ -311,6 +344,12 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
[[package]]
name = "cache-padded"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"
[[package]]
name = "cast"
version = "0.2.3"
@ -381,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8709d481fb78b9808f34a1b4b4fadd08a15a0971052c18bc2b751faefaed595e"
dependencies = [
"multibase",
"multihash",
"multihash 0.11.4",
"unsigned-varint 0.3.3",
]
@ -405,6 +444,15 @@ dependencies = [
"bitflags",
]
[[package]]
name = "concurrent-queue"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3"
dependencies = [
"cache-padded",
]
[[package]]
name = "const_fn"
version = "0.4.4"
@ -678,16 +726,6 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "dns-parser"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea"
dependencies = [
"byteorder",
"quick-error",
]
[[package]]
name = "domain"
version = "0.5.3"
@ -748,6 +786,15 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
[[package]]
name = "fastrand"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3"
dependencies = [
"instant",
]
[[package]]
name = "filetime"
version = "0.2.12"
@ -825,9 +872,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d8e3078b7b2a8a671cb7a3d17b4760e4181ea243227776ba83fd043b4ca034e"
checksum = "c70be434c505aee38639abccb918163b63158a4b4bb791b45b7023044bdc3c9c"
dependencies = [
"futures-channel",
"futures-core",
@ -840,9 +887,9 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74"
checksum = "f01c61843314e95f96cc9245702248733a3a3d744e43e2e755e3c7af8348a0a9"
dependencies = [
"futures-core",
"futures-sink",
@ -850,15 +897,15 @@ dependencies = [
[[package]]
name = "futures-core"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b"
checksum = "db8d3b0917ff63a2a96173133c02818fac4a746b0a57569d3baca9ec0e945e08"
[[package]]
name = "futures-executor"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc709ca1da6f66143b8c9bec8e6260181869893714e9b5a490b169b0414144ab"
checksum = "9ee9ca2f7eb4475772cf39dd1cd06208dce2670ad38f4d9c7262b3e15f127068"
dependencies = [
"futures-core",
"futures-task",
@ -868,15 +915,30 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c"
checksum = "e37c1a51b037b80922864b8eed90692c5cd8abd4c71ce49b77146caa47f3253b"
[[package]]
name = "futures-lite"
version = "1.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"memchr",
"parking",
"pin-project-lite 0.2.4",
"waker-fn",
]
[[package]]
name = "futures-macro"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b"
checksum = "0f8719ca0e1f3c5e34f3efe4570ef2c0610ca6da85ae7990d472e9cbfba13664"
dependencies = [
"proc-macro-hack",
"proc-macro2",
@ -886,15 +948,15 @@ dependencies = [
[[package]]
name = "futures-sink"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd"
checksum = "f6adabac1290109cfa089f79192fb6244ad2c3f1cc2281f3e1dd987592b71feb"
[[package]]
name = "futures-task"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94"
checksum = "a92a0843a2ff66823a8f7c77bffe9a09be2b64e533562c412d63075643ec0038"
dependencies = [
"once_cell",
]
@ -907,9 +969,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c"
[[package]]
name = "futures-util"
version = "0.3.6"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34"
checksum = "036a2107cdeb57f6d7322f1b6c363dad67cd63ca3b7d1b925bdf75bd5d96cda9"
dependencies = [
"futures-channel",
"futures-core",
@ -918,25 +980,13 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
"pin-project 0.4.26",
"pin-project-lite 0.2.4",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
"slab",
]
[[package]]
name = "futures_codec"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b"
dependencies = [
"bytes 0.5.6",
"futures",
"memchr",
"pin-project 0.4.26",
]
[[package]]
name = "fxhash"
version = "0.2.1"
@ -1060,6 +1110,12 @@ dependencies = [
"libc",
]
[[package]]
name = "hex"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35"
[[package]]
name = "hex-literal"
version = "0.3.1"
@ -1182,6 +1238,22 @@ dependencies = [
"libc",
]
[[package]]
name = "if-watch"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d"
dependencies = [
"async-io",
"futures",
"futures-lite",
"if-addrs",
"ipnet",
"libc",
"log",
"winapi 0.3.9",
]
[[package]]
name = "indexmap"
version = "1.6.0"
@ -1245,10 +1317,10 @@ dependencies = [
"ipfs-unixfs",
"libp2p",
"multibase",
"multihash",
"multihash 0.11.4",
"once_cell",
"prost",
"prost-build",
"prost 0.6.1",
"prost-build 0.6.1",
"rand",
"serde",
"serde_json",
@ -1275,9 +1347,9 @@ dependencies = [
"futures",
"libp2p-core",
"libp2p-swarm",
"multihash",
"prost",
"prost-build",
"multihash 0.11.4",
"prost 0.6.1",
"prost-build 0.6.1",
"thiserror",
"tokio 0.3.6",
"tracing",
@ -1299,12 +1371,12 @@ dependencies = [
"mime",
"mpart-async",
"multibase",
"multihash",
"multihash 0.11.4",
"openssl",
"parity-multiaddr",
"parity-multiaddr 0.9.6",
"percent-encoding",
"prost",
"prost-build",
"prost 0.6.1",
"prost-build 0.6.1",
"serde",
"serde_json",
"structopt",
@ -1331,7 +1403,7 @@ dependencies = [
"hex-literal",
"libc",
"multibase",
"multihash",
"multihash 0.11.4",
"quick-protobuf",
"sha2 0.9.1",
"tar",
@ -1406,12 +1478,11 @@ checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
[[package]]
name = "libp2p"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3c2b4c99f8798be90746fc226acf95d3e6cff0655883634cc30dab1f64f438b"
version = "0.34.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"atomic",
"bytes 0.5.6",
"bytes 1.0.1",
"futures",
"lazy_static",
"libp2p-core",
@ -1420,15 +1491,13 @@ dependencies = [
"libp2p-floodsub",
"libp2p-identify",
"libp2p-kad",
"libp2p-mdns",
"libp2p-mplex",
"libp2p-noise",
"libp2p-ping",
"libp2p-swarm",
"libp2p-tcp",
"libp2p-yamux",
"multihash",
"parity-multiaddr",
"parity-multiaddr 0.11.0",
"parking_lot",
"pin-project 1.0.4",
"smallvec",
@ -1437,9 +1506,8 @@ dependencies = [
[[package]]
name = "libp2p-core"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b8186060d6bd415e4e928e6cb44c4fe7e7a7dd53437bd936ce7e5f421e45a51"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"asn1_der",
"bs58",
@ -1451,29 +1519,28 @@ dependencies = [
"lazy_static",
"libsecp256k1",
"log",
"multihash",
"multihash 0.13.2",
"multistream-select",
"parity-multiaddr",
"parity-multiaddr 0.11.0",
"parking_lot",
"pin-project 1.0.4",
"prost",
"prost-build",
"prost 0.7.0",
"prost-build 0.7.0",
"rand",
"ring",
"rw-stream-sink",
"sha2 0.9.1",
"smallvec",
"thiserror",
"unsigned-varint 0.5.1",
"unsigned-varint 0.6.0",
"void",
"zeroize",
]
[[package]]
name = "libp2p-core-derive"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f753d9324cd3ec14bf04b8a8cd0d269c87f294153d6bf2a84497a63a5ad22213"
version = "0.21.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"quote",
"syn",
@ -1481,9 +1548,8 @@ dependencies = [
[[package]]
name = "libp2p-dns"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0baeff71fb5cb1fe1604f74a712a44b66a8c5900f4022411a1d550f09d6bb776"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"futures",
"libp2p-core",
@ -1492,9 +1558,8 @@ dependencies = [
[[package]]
name = "libp2p-floodsub"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db0f925a45f310b678e70faf71a10023b829d02eb9cc2628a63de928936f3ade"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"cuckoofilter",
"fnv",
@ -1502,109 +1567,82 @@ dependencies = [
"libp2p-core",
"libp2p-swarm",
"log",
"prost",
"prost-build",
"prost 0.7.0",
"prost-build 0.7.0",
"rand",
"smallvec",
]
[[package]]
name = "libp2p-identify"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e074124669840484de564901d47f2d0892e73f6d8ee7c37e9c2644af1b217bf4"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"futures",
"libp2p-core",
"libp2p-swarm",
"log",
"prost",
"prost-build",
"prost 0.7.0",
"prost-build 0.7.0",
"smallvec",
"wasm-timer",
]
[[package]]
name = "libp2p-kad"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78a2653b2e3254a3bbeb66bfc3f0dca7d6cba6aa2a96791db114003dec1b5394"
version = "0.28.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"arrayvec",
"bytes 0.5.6",
"asynchronous-codec",
"bytes 1.0.1",
"either",
"fnv",
"futures",
"futures_codec",
"libp2p-core",
"libp2p-swarm",
"log",
"multihash",
"prost",
"prost-build",
"prost 0.7.0",
"prost-build 0.7.0",
"rand",
"sha2 0.9.1",
"smallvec",
"uint",
"unsigned-varint 0.5.1",
"void",
"wasm-timer",
]
[[package]]
name = "libp2p-mdns"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786b068098794322239f8f04df88a52daeb7863b2e77501c4d85d32e0a8f2d26"
dependencies = [
"data-encoding",
"dns-parser",
"either",
"futures",
"lazy_static",
"libp2p-core",
"libp2p-swarm",
"log",
"net2",
"rand",
"smallvec",
"tokio 0.3.6",
"unsigned-varint 0.6.0",
"void",
"wasm-timer",
]
[[package]]
name = "libp2p-mplex"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed764eab613a8fb6b7dcf6c796f55a06fef2270e528329903e25cd3311b99663"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"bytes 0.5.6",
"asynchronous-codec",
"bytes 1.0.1",
"futures",
"futures_codec",
"libp2p-core",
"log",
"nohash-hasher",
"parking_lot",
"rand",
"smallvec",
"unsigned-varint 0.5.1",
"unsigned-varint 0.6.0",
]
[[package]]
name = "libp2p-noise"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb441fb015ec16690099c5d910fcba271d357763b3dcb784db7b27bbb0b68372"
version = "0.29.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"bytes 0.5.6",
"bytes 1.0.1",
"curve25519-dalek",
"futures",
"lazy_static",
"libp2p-core",
"log",
"prost",
"prost-build",
"prost 0.7.0",
"prost-build 0.7.0",
"rand",
"sha2 0.9.1",
"snow",
@ -1615,9 +1653,8 @@ dependencies = [
[[package]]
name = "libp2p-ping"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82e5c50936cfdbe96a514e8992f304fa44cd3a681b6f779505f1ae62b3474705"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"futures",
"libp2p-core",
@ -1630,9 +1667,8 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "565f0e06674b4033c978471e4083d5aaa8e03cef0719a0ec0905aaeaad39a919"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"either",
"futures",
@ -1646,25 +1682,26 @@ dependencies = [
[[package]]
name = "libp2p-tcp"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33f3dce259c0d3127af5167f45c275b6c047320efdd0e40fde947482487af0a3"
version = "0.27.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"async-io",
"futures",
"futures-timer",
"if-addrs",
"if-watch",
"ipnet",
"libc",
"libp2p-core",
"log",
"socket2",
"tokio 0.3.6",
"tokio 1.0.1",
]
[[package]]
name = "libp2p-yamux"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a0798cbb58535162c40858493d09af06eac42a26e4966e58de0df701f559348"
version = "0.30.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"futures",
"libp2p-core",
@ -1865,6 +1902,33 @@ dependencies = [
"unsigned-varint 0.5.1",
]
[[package]]
name = "multihash"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab"
dependencies = [
"digest 0.9.0",
"generic-array 0.14.4",
"multihash-derive",
"sha2 0.9.1",
"unsigned-varint 0.5.1",
]
[[package]]
name = "multihash-derive"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f"
dependencies = [
"proc-macro-crate",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
"synstructure",
]
[[package]]
name = "multimap"
version = "0.8.2"
@ -1873,16 +1937,25 @@ checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333"
[[package]]
name = "multistream-select"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93faf2e41f9ee62fb01680ed48f3cc26652352327aa2e59869070358f6b7dd75"
version = "0.10.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"bytes 0.5.6",
"bytes 1.0.1",
"futures",
"log",
"pin-project 1.0.4",
"smallvec",
"unsigned-varint 0.5.1",
"unsigned-varint 0.6.0",
]
[[package]]
name = "nb-connect"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998"
dependencies = [
"libc",
"winapi 0.3.9",
]
[[package]]
@ -2001,14 +2074,36 @@ dependencies = [
"bs58",
"byteorder",
"data-encoding",
"multihash",
"multihash 0.11.4",
"percent-encoding",
"serde",
"static_assertions",
"unsigned-varint 0.5.1",
]
[[package]]
name = "parity-multiaddr"
version = "0.11.0"
source = "git+https://github.com/libp2p/rust-libp2p.git#75b5fdfbca293b7ae8bb546b9730531016f4caea"
dependencies = [
"arrayref",
"bs58",
"byteorder",
"data-encoding",
"multihash 0.13.2",
"percent-encoding",
"serde",
"static_assertions",
"unsigned-varint 0.6.0",
"url",
]
[[package]]
name = "parking"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
[[package]]
name = "parking_lot"
version = "0.11.0"
@ -2127,6 +2222,19 @@ dependencies = [
"web-sys",
]
[[package]]
name = "polling"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4"
dependencies = [
"cfg-if 0.1.10",
"libc",
"log",
"wepoll-sys",
"winapi 0.3.9",
]
[[package]]
name = "poly1305"
version = "0.6.1"
@ -2152,6 +2260,15 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
[[package]]
name = "proc-macro-crate"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
dependencies = [
"toml",
]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
@ -2178,9 +2295,9 @@ dependencies = [
[[package]]
name = "proc-macro-hack"
version = "0.5.18"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]]
name = "proc-macro-nested"
@ -2204,7 +2321,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212"
dependencies = [
"bytes 0.5.6",
"prost-derive",
"prost-derive 0.6.1",
]
[[package]]
name = "prost"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2"
dependencies = [
"bytes 1.0.1",
"prost-derive 0.7.0",
]
[[package]]
@ -2219,10 +2346,28 @@ dependencies = [
"log",
"multimap",
"petgraph",
"prost",
"prost-types",
"prost 0.6.1",
"prost-types 0.6.1",
"tempfile",
"which",
"which 3.1.1",
]
[[package]]
name = "prost-build"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3"
dependencies = [
"bytes 1.0.1",
"heck",
"itertools 0.9.0",
"log",
"multimap",
"petgraph",
"prost 0.7.0",
"prost-types 0.7.0",
"tempfile",
"which 4.0.2",
]
[[package]]
@ -2238,6 +2383,19 @@ dependencies = [
"syn",
]
[[package]]
name = "prost-derive"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4"
dependencies = [
"anyhow",
"itertools 0.9.0",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "prost-types"
version = "0.6.1"
@ -2245,14 +2403,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa"
dependencies = [
"bytes 0.5.6",
"prost",
"prost 0.6.1",
]
[[package]]
name = "quick-error"
version = "1.2.3"
name = "prost-types"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb"
dependencies = [
"bytes 1.0.1",
"prost 0.7.0",
]
[[package]]
name = "quick-protobuf"
@ -2416,12 +2578,6 @@ dependencies = [
"crossbeam-utils 0.7.2",
]
[[package]]
name = "rustc-hex"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6"
[[package]]
name = "rustc_version"
version = "0.2.3"
@ -2866,9 +3022,7 @@ checksum = "720ba21c25078711bf456d607987d95bce90f7c3bea5abe1db587862e7a1e87c"
dependencies = [
"autocfg",
"bytes 0.6.0",
"libc",
"memchr",
"mio 0.7.7",
"pin-project-lite 0.2.4",
]
@ -2936,6 +3090,15 @@ dependencies = [
"tokio-stream",
]
[[package]]
name = "toml"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
dependencies = [
"serde",
]
[[package]]
name = "tower-service"
version = "0.3.0"
@ -3026,13 +3189,13 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
[[package]]
name = "uint"
version = "0.8.5"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177"
checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e"
dependencies = [
"byteorder",
"crunchy",
"rustc-hex",
"hex",
"static_assertions",
]
@ -3108,9 +3271,15 @@ name = "unsigned-varint"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35"
[[package]]
name = "unsigned-varint"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2"
dependencies = [
"bytes 0.5.6",
"futures_codec",
"asynchronous-codec",
"bytes 1.0.1",
]
[[package]]
@ -3136,6 +3305,12 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
[[package]]
name = "vec-arena"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d"
[[package]]
name = "vergen"
version = "3.1.0"
@ -3158,6 +3333,12 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
[[package]]
name = "waker-fn"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"
[[package]]
name = "walkdir"
version = "2.3.1"
@ -3309,6 +3490,15 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "wepoll-sys"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff"
dependencies = [
"cc",
]
[[package]]
name = "which"
version = "3.1.1"
@ -3318,6 +3508,16 @@ dependencies = [
"libc",
]
[[package]]
name = "which"
version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef"
dependencies = [
"libc",
"thiserror",
]
[[package]]
name = "widestring"
version = "0.4.3"

View File

@ -29,9 +29,9 @@ cid = { default-features = false, version = "0.5" }
dirs = { default-features = false, version = "3.0" }
domain = { default-features = false, git = "https://github.com/NLnetLabs/domain.git", features = ["resolv", "bytes"] }
either = { default-features = false, version = "1.5" }
futures = { default-features = false, version = "0.3.5", features = ["alloc", "std"] }
futures = { default-features = false, version = "0.3.9", features = ["alloc", "std"] }
ipfs-unixfs = { version = "0.2", path = "unixfs" }
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-tokio", "mdns-tokio", "mplex", "noise", "ping", "yamux", "dns"], version = "0.30" }
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-tokio", "mplex", "noise", "ping", "yamux", "dns"], git = "https://github.com/libp2p/rust-libp2p.git" }
multibase = { default-features = false, version = "0.8" }
multihash = { default-features = false, version = "0.11" }
prost = { default-features = false, version = "0.6" }

View File

@ -14,8 +14,8 @@ prost-build = { default-features = false, version = "0.6" }
cid = { default-features = false, version = "0.5" }
fnv = { default-features = false, version = "1.0" }
futures = { default-features = false, version = "0.3" }
libp2p-core = { default-features = false, version = "0.24" }
libp2p-swarm = { default-features = false, version = "0.24" }
libp2p-core = { default-features = false, git = "https://github.com/libp2p/rust-libp2p.git" }
libp2p-swarm = { default-features = false, git = "https://github.com/libp2p/rust-libp2p.git" }
multihash = { default-features = false, version = "0.11" }
prost = { default-features = false, version = "0.6" }
thiserror = { default-features = false, version = "1.0" }

View File

@ -3,8 +3,8 @@ use std::path::PathBuf;
use structopt::StructOpt;
use ipfs::{Ipfs, IpfsOptions, IpfsTypes, UninitializedIpfs};
use ipfs::{Multiaddr, Protocol};
use ipfs_http::{config, v0};
use parity_multiaddr::{Multiaddr, Protocol};
#[macro_use]
extern crate tracing;
@ -111,6 +111,7 @@ fn main() {
}
}
Options::Daemon => {
// FIXME: toctou, should just match for this err?
if !config_path.is_file() {
eprintln!("Error: no IPFS repo found in {:?}", home);
eprintln!("please run: 'ipfs init'");

View File

@ -315,7 +315,7 @@ where
use multibase::Base::Base64Pad;
let msg = msg.as_ref();
let from = Base64Pad.encode(msg.source.as_bytes());
let from = Base64Pad.encode(msg.source.to_bytes());
let data = Base64Pad.encode(&msg.data);
let seqno = Base64Pad.encode(&msg.sequence_number);
let topics = msg.topics.clone();

View File

@ -1404,7 +1404,9 @@ impl<TRepoTypes: RepoTypes> Future for IpfsFuture<TRepoTypes> {
// perhaps this could be moved under `IpfsEvent` or free functions?
let mut addresses = Vec::new();
addresses.extend(Swarm::listeners(&self.swarm).cloned());
addresses.extend(Swarm::external_addresses(&self.swarm).cloned());
addresses.extend(
Swarm::external_addresses(&self.swarm).map(|ar| ar.addr.clone()),
);
// ignore error, perhaps caller went away already
let _ = ret.send(addresses);
}

View File

@ -12,9 +12,9 @@ use libp2p::core::{Multiaddr, PeerId};
use libp2p::identify::{Identify, IdentifyEvent};
use libp2p::kad::record::{store::MemoryStore, Key, Record};
use libp2p::kad::{Kademlia, KademliaConfig, KademliaEvent, Quorum};
use libp2p::mdns::{MdnsEvent, TokioMdns};
// use libp2p::mdns::{MdnsEvent, TokioMdns};
use libp2p::ping::{Ping, PingEvent};
use libp2p::swarm::toggle::Toggle;
// use libp2p::swarm::toggle::Toggle;
use libp2p::swarm::{NetworkBehaviour, NetworkBehaviourEventProcess};
use multibase::Base;
use std::{convert::TryInto, sync::Arc};
@ -25,7 +25,7 @@ use tokio::task;
pub struct Behaviour<Types: IpfsTypes> {
#[behaviour(ignore)]
repo: Arc<Repo<Types>>,
mdns: Toggle<TokioMdns>,
// mdns: Toggle<TokioMdns>,
kademlia: Kademlia<MemoryStore>,
#[behaviour(ignore)]
kad_subscriptions: SubscriptionRegistry<KadResult, String>,
@ -54,6 +54,7 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<void::Void> for Behaviour<Ty
fn inject_event(&mut self, _event: void::Void) {}
}
/*
impl<Types: IpfsTypes> NetworkBehaviourEventProcess<MdnsEvent> for Behaviour<Types> {
fn inject_event(&mut self, event: MdnsEvent) {
match event {
@ -72,6 +73,7 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<MdnsEvent> for Behaviour<Typ
}
}
}
*/
impl<Types: IpfsTypes> NetworkBehaviourEventProcess<KademliaEvent> for Behaviour<Types> {
fn inject_event(&mut self, event: KademliaEvent) {
@ -417,12 +419,14 @@ impl<Types: IpfsTypes> Behaviour<Types> {
pub async fn new(options: SwarmOptions, repo: Arc<Repo<Types>>) -> Self {
info!("net: starting with peer id {}", options.peer_id);
/*
let mdns = if options.mdns {
Some(TokioMdns::new().expect("Failed to create mDNS service"))
} else {
None
}
.into();
*/
let store = MemoryStore::new(options.peer_id.to_owned());
@ -456,7 +460,7 @@ impl<Types: IpfsTypes> Behaviour<Types> {
Behaviour {
repo,
mdns,
// mdns,
kademlia,
kad_subscriptions: Default::default(),
bitswap,
@ -543,10 +547,11 @@ impl<Types: IpfsTypes> Behaviour<Types> {
}
pub fn get_closest_peers(&mut self, id: PeerId) -> SubscriptionFuture<KadResult, String> {
let id = id.to_base58();
// TODO: why was this base58?
// let id = id.to_base58();
self.kad_subscriptions
.create_subscription(self.kademlia.get_closest_peers(id.as_bytes()).into(), None)
.create_subscription(self.kademlia.get_closest_peers(id).into(), None)
}
pub fn get_providers(&mut self, cid: Cid) -> SubscriptionFuture<KadResult, String> {

View File

@ -430,8 +430,11 @@ impl NetworkBehaviour for Pubsub {
handler,
});
}
NetworkBehaviourAction::ReportObservedAddr { address } => {
return Poll::Ready(NetworkBehaviourAction::ReportObservedAddr { address });
NetworkBehaviourAction::ReportObservedAddr { address, score } => {
return Poll::Ready(NetworkBehaviourAction::ReportObservedAddr {
address,
score,
});
}
}
}

View File

@ -26,9 +26,7 @@ pub struct Disconnector {
}
impl Disconnector {
pub fn disconnect<T: NetworkBehaviour>(self, swarm: &mut Swarm<T>)
where <<<T as NetworkBehaviour>::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InEvent: std::clone::Clone
{
pub fn disconnect<T: NetworkBehaviour>(self, swarm: &mut Swarm<T>) {
Swarm::ban_peer_id(swarm, self.peer_id.clone());
Swarm::unban_peer_id(swarm, self.peer_id);
}
@ -280,7 +278,7 @@ mod tests {
for l in Swarm::listeners(&swarm1) {
let mut addr = l.to_owned();
addr.push(Protocol::P2p(
Multihash::from_bytes(peer1_id.clone().into_bytes()).unwrap(),
Multihash::from_bytes(&peer1_id.to_bytes()).unwrap(),
));
if let Some(fut) = swarm2.connect(addr.try_into().unwrap()) {
fut.await.unwrap();

View File

@ -518,7 +518,8 @@ impl<TRepoTypes: RepoTypes> Repo<TRepoTypes> {
let data_store = &self.data_store;
let key = ipns.to_owned();
let bytes = data_store.get(Column::Ipns, key.as_bytes()).await?;
// FIXME: needless vec<u8> creation
let bytes = data_store.get(Column::Ipns, &key.to_bytes()[..]).await?;
match bytes {
Some(ref bytes) => {
let string = String::from_utf8_lossy(bytes);
@ -533,14 +534,19 @@ impl<TRepoTypes: RepoTypes> Repo<TRepoTypes> {
pub async fn put_ipns(&self, ipns: &PeerId, path: &IpfsPath) -> Result<(), Error> {
let string = path.to_string();
let value = string.as_bytes();
// FIXME: needless vec<u8> creation
self.data_store
.put(Column::Ipns, ipns.as_bytes(), value)
.put(Column::Ipns, &ipns.to_bytes()[..], value)
.await
}
/// Remove an ipld path from the datastore.
pub async fn remove_ipns(&self, ipns: &PeerId) -> Result<(), Error> {
self.data_store.remove(Column::Ipns, ipns.as_bytes()).await
// FIXME: us needing to clone the peerid is wasteful to pass it as a reference only to be
// cloned again
self.data_store
.remove(Column::Ipns, &ipns.to_bytes()[..])
.await
}
/// Inserts a direct pin for a `Cid`.