pub async fn start_zone_p2p<N, T>(
blockchain_read_handle: BlockchainReadHandle,
blockchain_context_service: BlockchainContextService,
txpool_read_handle: TxpoolReadHandle,
config: P2PConfig<N>,
transport_config: TransportConfig<N, T>,
) -> Result<(NetworkInterface<N>, Sender<IncomingTxHandler>), BoxError>where
N: NetworkZone,
T: Transport<N>,
N::Addr: BorshDeserialize + BorshSerialize,
CrossNetworkInternalPeerId: From<InternalPeerID<<N as NetworkZone>::Addr>>,
Expand description
Starts the P2P network zone, returning a NetworkInterface
to interact with it.
A oneshot::Sender
is also returned to provide the IncomingTxHandler
, until this is provided network
handshakes can not be completed.