pub fn add_to_network(
    network: &mut NetworkBuilder,
) -> (
    OnchainDiscoveryNetworkSender,
    libra_channel::Receiver<(PeerId, ProtocolId), PeerManagerNotification>,
    conn_notifs_channel::Receiver,
) {
    let (network_sender, network_receiver, conn_reqs_tx, conn_notifs_rx) = network
        .add_protocol_handler(
            vec![ProtocolId::OnchainDiscoveryRpc],
            vec![],
            QueueStyle::LIFO,
            NETWORK_CHANNEL_SIZE,
            // Some(&counters::PENDING_CONSENSUS_NETWORK_EVENTS),
            // TODO(philiphayes): add a counter for onchain discovery
            None,
        );
    (
        OnchainDiscoveryNetworkSender::new(
            network_sender,
            conn_reqs_tx,
            network
                .conn_mgr_reqs_tx()
                .expect("ConnecitivtyManager not enabled"),
        ),
        network_receiver,
        conn_notifs_rx,
    )
}
/// Construct OnchainDiscoveryNetworkSender/Events and register them with the
/// given network builder.
Construct OnchainDiscoveryNetworkSender/Events and register them with the
given network builder.
Construct OnchainDiscoveryNetworkSender / Events and register them with the given network builder .
pub fn add_to_network(
    network: &mut NetworkBuilder,
) -> (
    OnchainDiscoveryNetworkSender,
    libra_channel::Receiver<(PeerId, ProtocolId), PeerManagerNotification>,
    conn_notifs_channel::Receiver,
) {
    let (network_sender, network_receiver, conn_reqs_tx, conn_notifs_rx) = network
        .add_protocol_handler(
            vec![ProtocolId::OnchainDiscoveryRpc],
            vec![],
            QueueStyle::LIFO,
            NETWORK_CHANNEL_SIZE,
            // Some(&counters::PENDING_CONSENSUS_NETWORK_EVENTS),
            // TODO(philiphayes): add a counter for onchain discovery
            None,
        );
    (
        OnchainDiscoveryNetworkSender::new(
            network_sender,
            conn_reqs_tx,
            network
                .conn_mgr_reqs_tx()
                .expect("ConnecitivtyManager not enabled"),
        ),
        network_receiver,
        conn_notifs_rx,
    )
}
pub fn add_to_network ( network : & mut NetworkBuilder , ) -> ( OnchainDiscoveryNetworkSender , libra_channel :: Receiver < ( PeerId , ProtocolId ) , PeerManagerNotification > , conn_notifs_channel :: Receiver , ) { let ( network_sender , network_receiver , conn_reqs_tx , conn_notifs_rx ) = network . add_protocol_handler ( vec ! [ ProtocolId OnchainDiscoveryRpc ] , vec ! [ ] , QueueStyle :: LIFO , NETWORK_CHANNEL_SIZE , // Some(&counters::PENDING_CONSENSUS_NETWORK_EVENTS), // TODO(philiphayes): add a counter for onchain discovery None , ) ; ( OnchainDiscoveryNetworkSender :: new ( network_sender , conn_reqs_tx , network . conn_mgr_reqs_tx ( ) . expect ( " " ) , ) , network_receiver , conn_notifs_rx , ) }
Construct OnchainDiscoveryNetworkSender/Events and register them with the
given network builder.
Construct OnchainDiscoveryNetworkSender / Events and register them with the given network builder .
network
&mut NetworkBuilder
network
&mut NetworkBuilder