[package]
name = "litep2p"
description = "Peer-to-peer networking library"
repository = "https://github.com/paritytech/litep2p"
license = "MIT"
version = "0.12.1"
edition = "2021"

# cargo-machete does not detect serde_millis usage, so we ignore the warning
[package.metadata.cargo-machete]
ignored = ["serde_millis"]

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

[dependencies]
async-trait = "0.1.88"
bs58 = "0.5.1"
bytes = "1.10.1"
cid = "0.11.1"
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
futures = "0.3.27"
futures-timer = "3.0.3"
indexmap = { version = "2.9.0", features = ["std"] }
libc = "0.2.158"
mockall = "0.13.1"
multiaddr = "0.17.0"
multihash = { version = "0.17.0", default-features = false, features = ["std", "multihash-impl", "identity", "sha2", "blake2b"] }
network-interface = "2.0.1"
parking_lot = "0.12.3"
pin-project = "1.1.10"
prost = "0.13.5"
rand = { version = "0.8.0", features = ["getrandom"] }
serde = "1.0.158"
sha2 = "0.10.9"
simple-dns = "0.11.0"
smallvec = "1.15.0"
snow = { version = "0.9.3", features = ["ring-resolver"], default-features = false }
socket2 = { version = "0.5.9", features = ["all"] }
thiserror = "2.0.12"
tokio-stream = "0.1.17"
tokio-util = { version = "0.7.15", features = ["compat", "io", "codec"] }
tokio = { version = "1.45.0", features = ["rt", "net", "io-util", "time", "macros", "sync", "parking_lot"] }
tracing = { version = "0.1.40", features = ["log"] }
hickory-resolver = "0.25.2"
uint = "0.10.0"
unsigned-varint = { version = "0.8.0", features = ["codec"] }
url = "2.5.4"
x25519-dalek = "2.0.1"
x509-parser = "0.17.0"
yasna = "0.5.0"
zeroize = "1.8.1"
yamux = "0.13.8"

# Websocket related dependencies.
tokio-tungstenite = { version = "0.27.0", features = ["rustls-tls-native-roots", "url"], optional = true }
# End of websocket related dependencies.

# Quic related dependencies. Quic is an experimental feature flag. The dependencies must be updated.
quinn = { version = "0.9.3", default-features = false, features = ["tls-rustls", "runtime-tokio"], optional = true }
rustls = { version = "0.20.7", default-features = false, features = ["dangerous_configuration"], optional = true }
ring = { version = "0.17.14", optional = true }
webpki = { version = "0.22.4", optional = true }
rcgen = { version = "0.14.5", optional = true }
# End of Quic related dependencies.

# WebRTC related dependencies. WebRTC is an experimental feature flag. The dependencies must be updated.
str0m = { version = "0.9.0", optional = true }
# End of WebRTC related dependencies.

# Fuzzing related dependencies.
serde_millis = {version = "0.1", optional = true}
enum-display = "0.1.4"
# End of fuzzing related dependencies.

[dev-dependencies]
libp2p = { version = "0.51.4", features = [
    "tokio",
    "dns",
    "identify",
    "macros",
    "mplex",
    "noise",
    "ping",
    "tcp",
    "kad",
    "websocket",
    "yamux",
    "quic",
]}
quickcheck = "1.0.3"
serde_json = "1.0.140"
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
futures_ringbuf = "0.4.0"
hex-literal = "1.0.0"

[features]
# Stable feature flags.
websocket = ["dep:tokio-tungstenite"]

# Fuzzing feature flags.
fuzz = ["serde/derive", "serde/rc", "bytes/serde", "dep:serde_millis", "cid/serde", "multihash/serde"]

# Unstable / experimental feature flags. These features are not guaranteed to be stable and may change in the future.
# They are not yet suitable for production use-cases and should be used with caution.
quic = ["dep:webpki", "dep:quinn", "dep:rustls", "dep:ring", "dep:rcgen"]
webrtc = ["dep:str0m"]
rsa = ["dep:ring"]

[profile.release]
debug = true

[[example]]
name = "echo_notification"
required-features = ["quic"]

[[example]]
name = "syncing"
required-features = ["quic"]
