Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Move libp2p meta crate into its own directory #3012

Closed
wants to merge 12 commits into from
Closed
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Build on ${{ matrix.toolchain }}
# TODO: also run `cargo test`
# TODO: ideally we would build `--workspace`, but not all crates compile for WASM
run: cargo build --target=${{ matrix.toolchain }} ${{ matrix.args }}
run: cargo build --package libp2p --target=${{ matrix.toolchain }} ${{ matrix.args }}

check-rustdoc-links:
name: Check rustdoc intra-doc links
Expand Down
1,005 changes: 25 additions & 980 deletions CHANGELOG.md

Large diffs are not rendered by default.

188 changes: 7 additions & 181 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,210 +1,36 @@
[package]
name = "libp2p"
edition = "2021"
rust-version = "1.60.0"
description = "Peer-to-peer networking library"
version = "0.50.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[features]
full = [
"async-std",
"autonat",
"dcutr",
"deflate",
"dns",
"ecdsa",
"floodsub",
"gossipsub",
"identify",
"kad",
"mdns",
"metrics",
"mplex",
"noise",
"ping",
"plaintext",
"pnet",
"relay",
"rendezvous",
"request-response",
"rsa",
"secp256k1",
"serde",
"tcp",
"tls",
"tokio",
"uds",
"wasm-bindgen",
"wasm-ext",
"wasm-ext-websocket",
"websocket",
"yamux",
]
autonat = ["dep:libp2p-autonat"]
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
deflate = ["dep:libp2p-deflate"]
dns = ["dep:libp2p-dns"]
floodsub = ["dep:libp2p-floodsub"]
identify = ["dep:libp2p-identify", "libp2p-metrics?/identify"]
kad = ["dep:libp2p-kad", "libp2p-metrics?/kad"]
gossipsub = ["dep:libp2p-gossipsub", "libp2p-metrics?/gossipsub"]
tls = ["dep:libp2p-tls"]
metrics = ["dep:libp2p-metrics"]
mdns = ["dep:libp2p-mdns"]
mplex = ["dep:libp2p-mplex"]
noise = ["dep:libp2p-noise"]
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
plaintext = ["dep:libp2p-plaintext"]
pnet = ["dep:libp2p-pnet"]
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
request-response = ["dep:libp2p-request-response"]
rendezvous = ["dep:libp2p-rendezvous"]
tcp = ["dep:libp2p-tcp"]
uds = ["dep:libp2p-uds"]
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js"]
wasm-ext = ["dep:libp2p-wasm-ext"]
wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"]
websocket = ["dep:libp2p-websocket"]
yamux = ["dep:libp2p-yamux"]
secp256k1 = ["libp2p-core/secp256k1"]
rsa = ["libp2p-core/rsa"]
ecdsa = ["libp2p-core/ecdsa"]
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
tokio = ["libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio"]
async-std = ["libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]

[dependencies]
bytes = "1"
futures = "0.3.1"
futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` feature
getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature
instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature
lazy_static = "1.2"

libp2p-autonat = { version = "0.8.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.37.0", path = "core" }
libp2p-dcutr = { version = "0.7.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.40.1", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.40.0", path = "protocols/identify", optional = true }
libp2p-kad = { version = "0.41.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.10.0", path = "misc/metrics", optional = true }
libp2p-mplex = { version = "0.37.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.40.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.40.1", path = "protocols/ping", optional = true }
libp2p-plaintext = { version = "0.37.0", path = "transports/plaintext", optional = true }
libp2p-pnet = { version = "0.22.1", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.13.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.10.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.22.1", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.40.1", path = "swarm" }
libp2p-swarm-derive = { version = "0.30.1", path = "swarm-derive" }
libp2p-uds = { version = "0.36.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.37.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.41.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.14.0" }
parking_lot = "0.12.0"
pin-project = "1.0.0"
smallvec = "1.6.1"

[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
libp2p-deflate = { version = "0.37.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.37.0", path = "transports/dns", optional = true }
libp2p-mdns = { version = "0.41.0", path = "protocols/mdns", optional = true }
libp2p-tcp = { version = "0.38.0", path = "transports/tcp", optional = true }
libp2p-websocket = { version = "0.39.0", path = "transports/websocket", optional = true }
libp2p-tls = { version = "0.1.0-alpha", path = "transports/tls", optional = true }

[target.'cfg(not(target_os = "unknown"))'.dependencies]
libp2p-gossipsub = { version = "0.42.1", path = "protocols/gossipsub", optional = true }

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
async-trait = "0.1"
env_logger = "0.9.0"
clap = { version = "4.0.13", features = ["derive"] }
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }

[workspace]
members = [
"core",
"misc/keygen",
"misc/metrics",
"misc/multistream-select",
"misc/rw-stream-sink",
"misc/keygen",
"misc/prost-codec",
"misc/quickcheck-ext",
"misc/rw-stream-sink",
"muxers/mplex",
"muxers/yamux",
"muxers/test-harness",
"protocols/dcutr",
"muxers/yamux",
"protocols/autonat",
"protocols/dcutr",
"protocols/floodsub",
"protocols/gossipsub",
"protocols/rendezvous",
"protocols/identify",
"protocols/kad",
"protocols/mdns",
"protocols/ping",
"protocols/relay",
"protocols/rendezvous",
"protocols/request-response",
"swarm",
"swarm-derive",
"transports/deflate",
"transports/dns",
"transports/noise",
"transports/tls",
"transports/plaintext",
"transports/pnet",
"transports/tcp",
"transports/tls",
"transports/uds",
"transports/websocket",
"transports/wasm-ext"
"transports/websocket",
]

[[example]]
name = "chat"
required-features = ["full"]

[[example]]
name = "chat-tokio"
required-features = ["full"]

[[example]]
name = "file-sharing"
required-features = ["full"]

[[example]]
name = "gossipsub-chat"
required-features = ["full"]

[[example]]
name = "ipfs-private"
required-features = ["full"]

[[example]]
name = "ipfs-kad"
required-features = ["full"]

[[example]]
name = "ping"
required-features = ["full"]

[[example]]
name = "mdns-passive-discovery"
required-features = ["full"]

[[example]]
name = "distributed-key-value-store"
required-features = ["full"]

# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustc-args = ["--cfg", "docsrs"]
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This repository is the central place for Rust development of the [libp2p](https:

- **Main documentation** can be found on https://docs.rs/libp2p.

- The **[examples](examples)** folder contains small binaries showcasing the
- The **[examples](libp2p/examples)** folder contains small binaries showcasing the
many protocols in this repository.

- For **security related issues** please reach out to [email protected]. Please
Expand All @@ -33,6 +33,11 @@ This repository is the central place for Rust development of the [libp2p](https:

The main components of this repository are structured as follows:

* `libp2p/`: The `libp2p` meta crate which re-exports everything else.

* `libp2p/examples/`: Worked examples of built-in application protocols (see `protocols/`)
with common `Transport` configurations.

* `core/`: The implementation of `libp2p-core` with its `Transport` and
`StreamMuxer` API on which almost all other crates depend.

Expand All @@ -53,9 +58,6 @@ The main components of this repository are structured as follows:

* `misc/`: Utility libraries.

* `examples/`: Worked examples of built-in application protocols (see `protocols/`)
with common `Transport` configurations.

## Community Guidelines

The libp2p project operates under the [IPFS Code of
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion core/Cargo.toml → libp2p-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ring = { version = "0.16.9", features = ["alloc", "std"], default-features = fal
async-std = { version = "1.6.2", features = ["attributes"] }
base64 = "0.13.0"
criterion = "0.4"
libp2p = { path = "..", features = ["full"] }
libp2p = { path = "../libp2p/", features = ["full"] }
multihash = { version = "0.16", default-features = false, features = ["arb"] }
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }
rmp-serde = "1.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion swarm-derive/Cargo.toml → libp2p-swarm-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ quote = "1.0"
syn = { version = "1.0.8", default-features = false, features = ["clone-impls", "derive", "parsing", "printing", "proc-macro"] }

[dev-dependencies]
libp2p = { path = "..", features = ["full"] }
libp2p = { path = "../libp2p/", features = ["full"] }
either = "1.6.0"
futures = "0.3.1"
void = "1"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions swarm/Cargo.toml → libp2p-swarm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fnv = "1.0"
futures = "0.3.1"
futures-timer = "3.0.2"
instant = "0.1.11"
libp2p-core = { version = "0.37.0", path = "../core" }
libp2p-core = { version = "0.37.0", path = "../libp2p-core" }
log = "0.4"
pin-project = "1.0.0"
rand = "0.8"
Expand All @@ -27,7 +27,7 @@ void = "1"
[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
env_logger = "0.9"
libp2p = { path = "..", features = ["full"] }
libp2p = { path = "../libp2p/", features = ["full"] }
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }

# Passing arguments to the docsrs builder in order to properly document cfg's.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading