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

chore: slim deps #255

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ categories = ["network-programming", "asynchronous"]
exclude = [".gitignore", ".github/*"]

[dependencies]
enr = { version = "0.12", features = ["k256", "ed25519"] }
enr = { version = "0.12", features = ["k256", "ed25519"] }
tokio = { version = "1", features = ["net", "sync", "macros", "rt"] }
libp2p = { version = "0.53", features = ["ed25519", "secp256k1"], optional = true }
libp2p-identity = { version = "0.2", features = [
"ed25519",
"secp256k1",
], optional = true }
multiaddr = { version = "0.18", optional = true }
zeroize = { version = "1", features = ["zeroize_derive"] }
futures = "0.3"
uint = { version = "0.9", default-features = false }
Expand Down Expand Up @@ -48,5 +52,5 @@ tokio = { version = "1", features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[features]
libp2p = ["dep:libp2p"]
libp2p = ["dep:libp2p-identity", "dep:multiaddr"]
serde = ["enr/serde"]
2 changes: 1 addition & 1 deletion src/discv5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use tokio::sync::{mpsc, oneshot};
use tracing::{debug, warn};

#[cfg(feature = "libp2p")]
use libp2p::Multiaddr;
use multiaddr::Multiaddr;

// Create lazy static variable for the global permit/ban list
use crate::{
Expand Down
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,11 @@ pub use packet::{DefaultProtocolId, ProtocolIdentity};
pub use permit_ban::PermitBanList;
pub use service::TalkRequest;
pub use socket::{ListenConfig, RateLimiter, RateLimiterBuilder};
// re-export the ENR crate
// Re-export the ENR crate
pub use enr;

// Re-export libp2p-identity and multiaddr
#[cfg(feature = "libp2p")]
pub use libp2p_identity;
#[cfg(feature = "libp2p")]
pub use multiaddr;
8 changes: 3 additions & 5 deletions src/node_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ use enr::{CombinedPublicKey, NodeId};
use std::net::SocketAddr;

#[cfg(feature = "libp2p")]
use libp2p::{
identity::{KeyType, PublicKey},
multiaddr::Protocol,
Multiaddr,
};
use libp2p_identity::{KeyType, PublicKey};
#[cfg(feature = "libp2p")]
use multiaddr::{Multiaddr, Protocol};

/// This type relaxes the requirement of having an ENR to connect to a node, to allow for unsigned
/// connection types, such as multiaddrs.
Expand Down
Loading