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,8 +14,8 @@ use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
use reth::builder::NodeHandle;
use reth_network::{
config::SecretKey, protocol::IntoRlpxSubProtocol, EthNetworkPrimitives, NetworkConfig,
NetworkManager, NetworkProtocols,
config::SecretKey, protocol::IntoRlpxSubProtocol, NetworkConfig, NetworkManager,
NetworkProtocols,
};
use reth_network_api::{test_utils::PeersHandleProvider, NetworkInfo};
use reth_node_ethereum::EthereumNode;
@ -53,7 +53,7 @@ fn main() -> eyre::Result<()> {
.build_with_noop_provider(node.chain_spec());
// spawn the second network instance
let subnetwork = NetworkManager::<EthNetworkPrimitives>::new(net_cfg).await?;
let subnetwork = NetworkManager::eth(net_cfg).await?;
let subnetwork_peer_id = *subnetwork.peer_id();
let subnetwork_peer_addr = subnetwork.local_addr();
let subnetwork_handle = subnetwork.peers_handle();