Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Move bitswap to its own crate (#12242)
Browse files Browse the repository at this point in the history
* Introduce `sc-network-bitswap`

Move the bitswap protocol out of `sc-network` to its own crate.

* Improve test coverage

* Remove mention of bitswap from `sc-network`

* Fix documentation

* Fix clippy and remove the void dependency

* Remove unneeded trait bound and bump prost to 0.11
  • Loading branch information
altonen authored Sep 13, 2022
1 parent 5daa20c commit c1103fd
Show file tree
Hide file tree
Showing 17 changed files with 708 additions and 494 deletions.
152 changes: 115 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ members = [
"client/keystore",
"client/network",
"client/network-gossip",
"client/network/bitswap",
"client/network/common",
"client/network/light",
"client/network/sync",
Expand Down
4 changes: 0 additions & 4 deletions client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ readme = "README.md"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
prost-build = "0.10"

[dependencies]
async-trait = "0.1"
asynchronous-codec = "0.6"
Expand Down Expand Up @@ -43,7 +40,6 @@ serde_json = "1.0.85"
smallvec = "1.8.0"
thiserror = "1.0"
unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_codec"] }
void = "1.0.2"
zeroize = "1.4.3"
fork-tree = { version = "3.0.0", path = "../../utils/fork-tree" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
Expand Down
40 changes: 40 additions & 0 deletions client/network/bitswap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
description = "Substrate bitswap protocol"
name = "sc-network-bitswap"
version = "0.10.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
documentation = "https://docs.rs/sc-network-bitswap"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
prost-build = "0.11"

[dependencies]
cid = "0.8.6"
futures = "0.3.21"
libp2p = "0.46.1"
log = "0.4.17"
prost = "0.11"
thiserror = "1.0"
unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_codec"] }
void = "1.0.2"
sc-client-api = { version = "4.0.0-dev", path = "../../api" }
sc-network-common = { version = "0.10.0-dev", path = "../common" }
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
sp-runtime = { version = "6.0.0", path = "../../../primitives/runtime" }

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
sc-consensus = { version = "0.10.0-dev", path = "../../consensus/common" }
sp-core = { version = "6.0.0", path = "../../../primitives/core" }
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
substrate-test-runtime = { version = "2.0.0", path = "../../../test-utils/runtime" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const PROTOS: &[&str] = &["src/schema/bitswap.v1.2.0.proto"];
const PROTOS: &[&str] = &["bitswap.v1.2.0.proto"];

fn main() {
prost_build::compile_protos(PROTOS, &["src/schema"]).unwrap();
Expand Down
Loading

0 comments on commit c1103fd

Please sign in to comment.