Skip to content

Commit

Permalink
add basic peer manager code
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Jan 22, 2025
1 parent 49f69c0 commit 01ebfd7
Show file tree
Hide file tree
Showing 13 changed files with 3,973 additions and 39 deletions.
68 changes: 40 additions & 28 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 @@ -85,6 +85,7 @@ parking_lot = "0.12"
reqwest = "0.12.12"
rusqlite = "0.28.0"
serde = { version = "1.0.208", features = ["derive"] }
smallvec = "2.0.0-alpha.9"
strum = { version = "0.24", features = ["derive"] }
tokio = { version = "1.39.2", features = [
"rt",
Expand Down
6 changes: 6 additions & 0 deletions anchor/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ edition = { workspace = true }
authors = ["Sigma Prime <[email protected]>"]

[dependencies]
arbitrary = "1.4.1"
delay_map = "0.4"
dirs = { workspace = true }
discv5 = { workspace = true }
ethereum_serde_utils = "1.0.0-beta.0"
Expand All @@ -25,13 +27,17 @@ libp2p = { version = "0.54", default-features = false, features = [
"ping",
] }
lighthouse_network = { workspace = true }
parking_lot = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
ssz_types = "0.10"
task_executor = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
types = { workspace = true }
version = { workspace = true }
itertools = "0.10.5"
strum = "0.24.1"

[dev-dependencies]
async-channel = { workspace = true }
3 changes: 3 additions & 0 deletions anchor/network/src/behaviour.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::discovery::Discovery;
use crate::peer_manager::PeerManager;
use libp2p::swarm::NetworkBehaviour;
use libp2p::{gossipsub, identify, ping};

Expand All @@ -12,4 +13,6 @@ pub struct AnchorBehaviour {
pub gossipsub: gossipsub::Behaviour,
/// Discv5 Discovery protocol.
pub discovery: Discovery,
/// The peer manager that keeps track of peer's reputation and status.
pub peer_manager: PeerManager,
}
Loading

0 comments on commit 01ebfd7

Please sign in to comment.