Struct network::peer_manager::builder::PeerManagerBuilder
source · pub struct PeerManagerBuilder { /* private fields */ }
Implementations§
source§impl PeerManagerBuilder
impl PeerManagerBuilder
pub fn create( chain_id: ChainId, network_context: Arc<NetworkContext>, time_service: TimeService, listen_address: NetworkAddress, peer_metadata_storage: Arc<PeerMetadataStorage>, trusted_peers: Arc<RwLock<PeerSet>>, authentication_mode: AuthenticationMode, channel_size: usize, max_concurrent_network_reqs: usize, max_frame_size: usize, enable_proxy_protocol: bool, inbound_connection_limit: usize, inbound_rate_limit_config: Option<RateLimitConfig>, outbound_rate_limit_config: Option<RateLimitConfig> ) -> Self
pub fn listen_address(&self) -> NetworkAddress
pub fn connection_reqs_tx(&self) -> Sender<PeerId, ConnectionRequest>
sourcepub fn build(&mut self, executor: &Handle) -> &mut Self
pub fn build(&mut self, executor: &Handle) -> &mut Self
Create the configured transport and start PeerManager. Return the actual NetworkAddress over which this peer is listening.
pub fn start(&mut self, executor: &Handle)
pub fn add_connection_event_listener(&mut self) -> Receiver
sourcepub fn add_protocol_handler(
&mut self,
rpc_protocols: Vec<ProtocolId>,
direct_send_protocols: Vec<ProtocolId>,
queue_preference: QueueStyle,
max_queue_size_per_peer: usize,
counter: Option<&'static IntCounterVec>
) -> (PeerManagerRequestSender, Receiver<(PeerId, ProtocolId), PeerManagerNotification>, ConnectionRequestSender, Receiver)
pub fn add_protocol_handler( &mut self, rpc_protocols: Vec<ProtocolId>, direct_send_protocols: Vec<ProtocolId>, queue_preference: QueueStyle, max_queue_size_per_peer: usize, counter: Option<&'static IntCounterVec> ) -> (PeerManagerRequestSender, Receiver<(PeerId, ProtocolId), PeerManagerNotification>, ConnectionRequestSender, Receiver)
Add a handler for given protocols using raw bytes.