mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-03 22:52:16 +00:00
chore: move libp2p
crate to a dedicated directory
Currently, our top-level `Cargo.toml` manifest represents a crate AND a workspace. This causes surprising behaviour (e.g. #2949) where we need to explicitly pass `--workpace` to every command to run it on the entire workspace and not just the meta crate. My moving the meta crate into its own directory, the root manifest file is a virtual manifest only and thus, every `cargo` command will automatically default to running on the entire workspace. On top of this, I personally find it easier to understand if workspace and crate manifests are not mixed. Pull-Request: #3536.
This commit is contained in:
parent
645b229d43
commit
d53cfed236
149
Cargo.toml
149
Cargo.toml
@ -1,144 +1,3 @@
|
|||||||
[package]
|
|
||||||
name = "libp2p"
|
|
||||||
edition = "2021"
|
|
||||||
rust-version = "1.65.0"
|
|
||||||
description = "Peer-to-peer networking library"
|
|
||||||
version = "0.51.0"
|
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
|
||||||
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",
|
|
||||||
"quic",
|
|
||||||
"macros",
|
|
||||||
"relay",
|
|
||||||
"rendezvous",
|
|
||||||
"request-response",
|
|
||||||
"rsa",
|
|
||||||
"secp256k1",
|
|
||||||
"serde",
|
|
||||||
"tcp",
|
|
||||||
"tls",
|
|
||||||
"tokio",
|
|
||||||
"uds",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"wasm-ext",
|
|
||||||
"wasm-ext-websocket",
|
|
||||||
"webrtc",
|
|
||||||
"websocket",
|
|
||||||
"yamux",
|
|
||||||
]
|
|
||||||
|
|
||||||
async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std"]
|
|
||||||
autonat = ["dep:libp2p-autonat"]
|
|
||||||
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
|
|
||||||
deflate = ["dep:libp2p-deflate"]
|
|
||||||
dns = ["dep:libp2p-dns"]
|
|
||||||
ecdsa = ["libp2p-core/ecdsa"]
|
|
||||||
floodsub = ["dep:libp2p-floodsub"]
|
|
||||||
gossipsub = ["dep:libp2p-gossipsub", "libp2p-metrics?/gossipsub"]
|
|
||||||
identify = ["dep:libp2p-identify", "libp2p-metrics?/identify"]
|
|
||||||
kad = ["dep:libp2p-kad", "libp2p-metrics?/kad"]
|
|
||||||
macros = ["libp2p-swarm/macros"]
|
|
||||||
mdns = ["dep:libp2p-mdns"]
|
|
||||||
metrics = ["dep:libp2p-metrics"]
|
|
||||||
mplex = ["dep:libp2p-mplex"]
|
|
||||||
noise = ["dep:libp2p-noise"]
|
|
||||||
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
|
|
||||||
plaintext = ["dep:libp2p-plaintext"]
|
|
||||||
pnet = ["dep:libp2p-pnet"]
|
|
||||||
quic = ["dep:libp2p-quic"]
|
|
||||||
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
|
|
||||||
rendezvous = ["dep:libp2p-rendezvous"]
|
|
||||||
request-response = ["dep:libp2p-request-response"]
|
|
||||||
rsa = ["libp2p-core/rsa"]
|
|
||||||
secp256k1 = ["libp2p-core/secp256k1"]
|
|
||||||
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
|
||||||
tcp = ["dep:libp2p-tcp"]
|
|
||||||
tls = ["dep:libp2p-tls"]
|
|
||||||
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio", "libp2p-webrtc?/tokio"]
|
|
||||||
uds = ["dep:libp2p-uds"]
|
|
||||||
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen"]
|
|
||||||
wasm-ext = ["dep:libp2p-wasm-ext"]
|
|
||||||
wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"]
|
|
||||||
webrtc = ["dep:libp2p-webrtc", "libp2p-webrtc?/pem"]
|
|
||||||
websocket = ["dep:libp2p-websocket"]
|
|
||||||
yamux = ["dep:libp2p-yamux"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
bytes = "1"
|
|
||||||
futures = "0.3.26"
|
|
||||||
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
|
|
||||||
|
|
||||||
libp2p-autonat = { version = "0.10.0", path = "protocols/autonat", optional = true }
|
|
||||||
libp2p-core = { version = "0.39.0", path = "core" }
|
|
||||||
libp2p-dcutr = { version = "0.9.0", path = "protocols/dcutr", optional = true }
|
|
||||||
libp2p-floodsub = { version = "0.42.0", path = "protocols/floodsub", optional = true }
|
|
||||||
libp2p-identify = { version = "0.42.0", path = "protocols/identify", optional = true }
|
|
||||||
libp2p-kad = { version = "0.43.0", path = "protocols/kad", optional = true }
|
|
||||||
libp2p-metrics = { version = "0.12.0", path = "misc/metrics", optional = true }
|
|
||||||
libp2p-mplex = { version = "0.39.0", path = "muxers/mplex", optional = true }
|
|
||||||
libp2p-noise = { version = "0.42.0", path = "transports/noise", optional = true }
|
|
||||||
libp2p-ping = { version = "0.42.0", path = "protocols/ping", optional = true }
|
|
||||||
libp2p-plaintext = { version = "0.39.0", path = "transports/plaintext", optional = true }
|
|
||||||
libp2p-pnet = { version = "0.22.2", path = "transports/pnet", optional = true }
|
|
||||||
libp2p-relay = { version = "0.15.0", path = "protocols/relay", optional = true }
|
|
||||||
libp2p-rendezvous = { version = "0.12.0", path = "protocols/rendezvous", optional = true }
|
|
||||||
libp2p-request-response = { version = "0.24.0", path = "protocols/request-response", optional = true }
|
|
||||||
libp2p-swarm = { version = "0.42.0", path = "swarm" }
|
|
||||||
libp2p-wasm-ext = { version = "0.39.0", path = "transports/wasm-ext", optional = true }
|
|
||||||
libp2p-yamux = { version = "0.43.0", path = "muxers/yamux", optional = true }
|
|
||||||
multiaddr = { version = "0.17.0" }
|
|
||||||
pin-project = "1.0.0"
|
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
|
|
||||||
libp2p-deflate = { version = "0.39.0", path = "transports/deflate", optional = true }
|
|
||||||
libp2p-dns = { version = "0.39.0", path = "transports/dns", optional = true }
|
|
||||||
libp2p-mdns = { version = "0.43.0", path = "protocols/mdns", optional = true }
|
|
||||||
libp2p-quic = { version = "=0.7.0-alpha.2", path = "transports/quic", optional = true }
|
|
||||||
libp2p-tcp = { version = "0.39.0", path = "transports/tcp", optional = true }
|
|
||||||
libp2p-tls = { version = "=0.1.0-alpha.2", path = "transports/tls", optional = true }
|
|
||||||
libp2p-uds = { version = "0.38.0", path = "transports/uds", optional = true }
|
|
||||||
libp2p-webrtc = { version = "=0.4.0-alpha.2", path = "transports/webrtc", optional = true }
|
|
||||||
libp2p-websocket = { version = "0.41.0", path = "transports/websocket", optional = true }
|
|
||||||
|
|
||||||
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
|
||||||
libp2p-gossipsub = { version = "0.44.0", path = "protocols/gossipsub", optional = true }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
async-std = { version = "1.6.2", features = ["attributes"] }
|
|
||||||
async-trait = "0.1"
|
|
||||||
either = "1.8.0"
|
|
||||||
env_logger = "0.10.0"
|
|
||||||
clap = { version = "4.1.6", features = ["derive"] }
|
|
||||||
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }
|
|
||||||
|
|
||||||
libp2p-mplex = { path = "muxers/mplex" }
|
|
||||||
libp2p-noise = { path = "transports/noise" }
|
|
||||||
libp2p-tcp = { path = "transports/tcp", features = ["tokio"] }
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"core",
|
"core",
|
||||||
@ -189,10 +48,4 @@ members = [
|
|||||||
"transports/webrtc",
|
"transports/webrtc",
|
||||||
"interop-tests"
|
"interop-tests"
|
||||||
]
|
]
|
||||||
|
resolver = "2"
|
||||||
# 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"]
|
|
||||||
|
@ -12,7 +12,7 @@ This repository is the central place for Rust development of the [libp2p](https:
|
|||||||
|
|
||||||
- **Main documentation** can be found on https://docs.rs/libp2p.
|
- **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.
|
many protocols in this repository.
|
||||||
|
|
||||||
- For **security related issues** please [file a private security vulnerability
|
- For **security related issues** please [file a private security vulnerability
|
||||||
@ -56,7 +56,7 @@ The main components of this repository are structured as follows:
|
|||||||
|
|
||||||
* `misc/`: Utility libraries.
|
* `misc/`: Utility libraries.
|
||||||
|
|
||||||
* `examples/`: Worked examples of built-in application protocols (see `protocols/`)
|
* `libp2p/examples/`: Worked examples of built-in application protocols (see `protocols/`)
|
||||||
with common `Transport` configurations.
|
with common `Transport` configurations.
|
||||||
|
|
||||||
## Community Guidelines
|
## Community Guidelines
|
||||||
|
@ -3,10 +3,11 @@ name = "chat-example"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "gossipsub", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "gossipsub", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
|
||||||
|
@ -3,11 +3,12 @@ name = "dcutr"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.1.6", features = ["derive"] }
|
clap = { version = "4.1.6", features = ["derive"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
futures-timer = "3.0"
|
futures-timer = "3.0"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
@ -3,11 +3,12 @@ name = "distributed-key-value-store"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "kad", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "mplex", "noise", "macros", "tcp", "websocket", "yamux"] }
|
||||||
multiaddr = { version = "0.17.0" }
|
multiaddr = { version = "0.17.0" }
|
||||||
|
@ -3,6 +3,7 @@ name = "file-sharing"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
@ -11,5 +12,5 @@ clap = { version = "4.1.6", features = ["derive"] }
|
|||||||
either = "1.8"
|
either = "1.8"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "kad", "mplex", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] }
|
||||||
multiaddr = { version = "0.17.0" }
|
multiaddr = { version = "0.17.0" }
|
||||||
|
@ -3,9 +3,10 @@ name = "identify"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "mplex", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||||
|
@ -3,10 +3,11 @@ name = "ipfs-kad"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "kad", "mplex", "noise", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mplex", "noise", "tcp", "websocket", "yamux"] }
|
||||||
|
@ -3,6 +3,7 @@ name = "ipfs-private"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
@ -10,5 +11,5 @@ async-trait = "0.1"
|
|||||||
either = "1.8"
|
either = "1.8"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "mplex", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "dns", "identify", "kad", "macros", "mplex", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
|
||||||
multiaddr = { version = "0.17.0" }
|
multiaddr = { version = "0.17.0" }
|
||||||
|
@ -3,10 +3,11 @@ name = "ping-example"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "dns", "macros", "mplex", "noise", "ping", "tcp", "websocket", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "macros", "mplex", "noise", "ping", "tcp", "websocket", "yamux"] }
|
||||||
multiaddr = { version = "0.17.0" }
|
multiaddr = { version = "0.17.0" }
|
||||||
|
@ -3,12 +3,13 @@ name = "rendezvous-example"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../../", features = ["async-std", "identify", "macros", "mplex", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "mplex", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
tokio = { version = "1.25", features = [ "rt-multi-thread", "macros", "time" ] }
|
tokio = { version = "1.25", features = [ "rt-multi-thread", "macros", "time" ] }
|
||||||
|
@ -3,13 +3,14 @@ edition = "2021"
|
|||||||
name = "interop-tests"
|
name = "interop-tests"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
publish = false
|
publish = false
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
either = "1.8.0"
|
either = "1.8.0"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
libp2p = { path = "../", features = ["websocket", "quic", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros", "webrtc"] }
|
libp2p = { path = "../libp2p", features = ["websocket", "quic", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros", "webrtc"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] }
|
redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] }
|
||||||
|
147
libp2p/Cargo.toml
Normal file
147
libp2p/Cargo.toml
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
[package]
|
||||||
|
name = "libp2p"
|
||||||
|
edition = "2021"
|
||||||
|
rust-version = "1.65.0"
|
||||||
|
description = "Peer-to-peer networking library"
|
||||||
|
version = "0.51.0"
|
||||||
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
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",
|
||||||
|
"quic",
|
||||||
|
"macros",
|
||||||
|
"relay",
|
||||||
|
"rendezvous",
|
||||||
|
"request-response",
|
||||||
|
"rsa",
|
||||||
|
"secp256k1",
|
||||||
|
"serde",
|
||||||
|
"tcp",
|
||||||
|
"tls",
|
||||||
|
"tokio",
|
||||||
|
"uds",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-ext",
|
||||||
|
"wasm-ext-websocket",
|
||||||
|
"webrtc",
|
||||||
|
"websocket",
|
||||||
|
"yamux",
|
||||||
|
]
|
||||||
|
|
||||||
|
async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std"]
|
||||||
|
autonat = ["dep:libp2p-autonat"]
|
||||||
|
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
|
||||||
|
deflate = ["dep:libp2p-deflate"]
|
||||||
|
dns = ["dep:libp2p-dns"]
|
||||||
|
ecdsa = ["libp2p-core/ecdsa"]
|
||||||
|
floodsub = ["dep:libp2p-floodsub"]
|
||||||
|
gossipsub = ["dep:libp2p-gossipsub", "libp2p-metrics?/gossipsub"]
|
||||||
|
identify = ["dep:libp2p-identify", "libp2p-metrics?/identify"]
|
||||||
|
kad = ["dep:libp2p-kad", "libp2p-metrics?/kad"]
|
||||||
|
macros = ["libp2p-swarm/macros"]
|
||||||
|
mdns = ["dep:libp2p-mdns"]
|
||||||
|
metrics = ["dep:libp2p-metrics"]
|
||||||
|
mplex = ["dep:libp2p-mplex"]
|
||||||
|
noise = ["dep:libp2p-noise"]
|
||||||
|
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
|
||||||
|
plaintext = ["dep:libp2p-plaintext"]
|
||||||
|
pnet = ["dep:libp2p-pnet"]
|
||||||
|
quic = ["dep:libp2p-quic"]
|
||||||
|
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
|
||||||
|
rendezvous = ["dep:libp2p-rendezvous"]
|
||||||
|
request-response = ["dep:libp2p-request-response"]
|
||||||
|
rsa = ["libp2p-core/rsa"]
|
||||||
|
secp256k1 = ["libp2p-core/secp256k1"]
|
||||||
|
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
||||||
|
tcp = ["dep:libp2p-tcp"]
|
||||||
|
tls = ["dep:libp2p-tls"]
|
||||||
|
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio", "libp2p-webrtc?/tokio"]
|
||||||
|
uds = ["dep:libp2p-uds"]
|
||||||
|
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen"]
|
||||||
|
wasm-ext = ["dep:libp2p-wasm-ext"]
|
||||||
|
wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"]
|
||||||
|
webrtc = ["dep:libp2p-webrtc", "libp2p-webrtc?/pem"]
|
||||||
|
websocket = ["dep:libp2p-websocket"]
|
||||||
|
yamux = ["dep:libp2p-yamux"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bytes = "1"
|
||||||
|
futures = "0.3.26"
|
||||||
|
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
|
||||||
|
|
||||||
|
libp2p-autonat = { version = "0.10.0", path = "../protocols/autonat", optional = true }
|
||||||
|
libp2p-core = { version = "0.39.0", path = "../core" }
|
||||||
|
libp2p-dcutr = { version = "0.9.0", path = "../protocols/dcutr", optional = true }
|
||||||
|
libp2p-floodsub = { version = "0.42.0", path = "../protocols/floodsub", optional = true }
|
||||||
|
libp2p-identify = { version = "0.42.0", path = "../protocols/identify", optional = true }
|
||||||
|
libp2p-kad = { version = "0.43.0", path = "../protocols/kad", optional = true }
|
||||||
|
libp2p-metrics = { version = "0.12.0", path = "../misc/metrics", optional = true }
|
||||||
|
libp2p-mplex = { version = "0.39.0", path = "../muxers/mplex", optional = true }
|
||||||
|
libp2p-noise = { version = "0.42.0", path = "../transports/noise", optional = true }
|
||||||
|
libp2p-ping = { version = "0.42.0", path = "../protocols/ping", optional = true }
|
||||||
|
libp2p-plaintext = { version = "0.39.0", path = "../transports/plaintext", optional = true }
|
||||||
|
libp2p-pnet = { version = "0.22.2", path = "../transports/pnet", optional = true }
|
||||||
|
libp2p-relay = { version = "0.15.0", path = "../protocols/relay", optional = true }
|
||||||
|
libp2p-rendezvous = { version = "0.12.0", path = "../protocols/rendezvous", optional = true }
|
||||||
|
libp2p-request-response = { version = "0.24.0", path = "../protocols/request-response", optional = true }
|
||||||
|
libp2p-swarm = { version = "0.42.0", path = "../swarm" }
|
||||||
|
libp2p-wasm-ext = { version = "0.39.0", path = "../transports/wasm-ext", optional = true }
|
||||||
|
libp2p-yamux = { version = "0.43.0", path = "../muxers/yamux", optional = true }
|
||||||
|
multiaddr = { version = "0.17.0" }
|
||||||
|
pin-project = "1.0.0"
|
||||||
|
|
||||||
|
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
|
||||||
|
libp2p-deflate = { version = "0.39.0", path = "../transports/deflate", optional = true }
|
||||||
|
libp2p-dns = { version = "0.39.0", path = "../transports/dns", optional = true }
|
||||||
|
libp2p-mdns = { version = "0.43.0", path = "../protocols/mdns", optional = true }
|
||||||
|
libp2p-quic = { version = "=0.7.0-alpha.2", path = "../transports/quic", optional = true }
|
||||||
|
libp2p-tcp = { version = "0.39.0", path = "../transports/tcp", optional = true }
|
||||||
|
libp2p-tls = { version = "=0.1.0-alpha.2", path = "../transports/tls", optional = true }
|
||||||
|
libp2p-uds = { version = "0.38.0", path = "../transports/uds", optional = true }
|
||||||
|
libp2p-webrtc = { version = "=0.4.0-alpha.2", path = "../transports/webrtc", optional = true }
|
||||||
|
libp2p-websocket = { version = "0.41.0", path = "../transports/websocket", optional = true }
|
||||||
|
|
||||||
|
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
||||||
|
libp2p-gossipsub = { version = "0.44.0", path = "../protocols/gossipsub", optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
async-std = { version = "1.6.2", features = ["attributes"] }
|
||||||
|
async-trait = "0.1"
|
||||||
|
either = "1.8.0"
|
||||||
|
env_logger = "0.10.0"
|
||||||
|
clap = { version = "4.1.6", features = ["derive"] }
|
||||||
|
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }
|
||||||
|
|
||||||
|
libp2p-mplex = { path = "../muxers/mplex" }
|
||||||
|
libp2p-noise = { path = "../transports/noise" }
|
||||||
|
libp2p-tcp = { path = "../transports/tcp", features = ["tokio"] }
|
||||||
|
|
||||||
|
# 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"]
|
27
libp2p/examples/README.md
Normal file
27
libp2p/examples/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Examples
|
||||||
|
|
||||||
|
A set of examples showcasing how to use rust-libp2p.
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
|
||||||
|
## Individual libp2p features
|
||||||
|
|
||||||
|
- [Chat](./chat) A basic chat application demonstrating libp2p and the mDNS and Gossipsub protocols.
|
||||||
|
- [Distributed key-value store](./distributed-key-value-store) A basic key value store demonstrating libp2p and the mDNS and Kademlia protocol.
|
||||||
|
|
||||||
|
- [File sharing application](./file-sharing) Basic file sharing application with peers either providing or locating and getting files by name.
|
||||||
|
|
||||||
|
While obviously showcasing how to build a basic file sharing application with the Kademlia and
|
||||||
|
Request-Response protocol, the actual goal of this example is **to show how to integrate
|
||||||
|
rust-libp2p into a larger application**.
|
||||||
|
|
||||||
|
- [IPFS Kademlia](./ipfs-kad) Demonstrates how to perform Kademlia queries on the IPFS network.
|
||||||
|
|
||||||
|
- [IPFS Private](./ipfs-private) Implementation using the gossipsub, ping and identify protocols to implement the ipfs private swarms feature.
|
||||||
|
|
||||||
|
- [Ping](./ping) Small `ping` clone, sending a ping to a peer, expecting a pong as a response. See [tutorial](../src/tutorials/ping.rs) for a step-by-step guide building the example.
|
||||||
|
|
||||||
|
|
||||||
|
- [Rendezvous](./rendezvous) Rendezvous Protocol. See [specs](https://github.com/libp2p/specs/blob/master/rendezvous/README.md).
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user