feat: add NetworkManager::eth (#13936)

This commit is contained in:
Matthias Seitz
2025-01-23 00:05:36 +01:00
committed by GitHub
parent 24c5234a50
commit 4dcc135495
5 changed files with 28 additions and 14 deletions

View File

@ -14,9 +14,7 @@
use chainspec::{boot_nodes, bsc_chain_spec};
use reth_discv4::Discv4ConfigBuilder;
use reth_network::{
EthNetworkPrimitives, NetworkConfig, NetworkEvent, NetworkEventListenerProvider, NetworkManager,
};
use reth_network::{NetworkConfig, NetworkEvent, NetworkEventListenerProvider, NetworkManager};
use reth_network_api::{
events::{PeerEvent, SessionInfo},
PeersInfo,
@ -69,7 +67,7 @@ async fn main() {
// latest BSC forkId, we need to override this to allow connections from BSC nodes
let fork_id = ForkId { hash: ForkHash([0x07, 0xb5, 0x43, 0x28]), next: 0 };
net_cfg.fork_filter.set_current_fork_id(fork_id);
let net_manager = NetworkManager::<EthNetworkPrimitives>::new(net_cfg).await.unwrap();
let net_manager = NetworkManager::eth(net_cfg).await.unwrap();
// The network handle is our entrypoint into the network.
let net_handle = net_manager.handle().clone();