Function cuprate_p2p::initialize_network
source · pub async fn initialize_network<N, R, CS>(
peer_req_handler: R,
core_sync_svc: CS,
config: P2PConfig<N>,
) -> Result<NetworkInterface<N>, BoxError>Expand description
Initializes the P2P NetworkInterface for a specific NetworkZone.
This function starts all the tasks to maintain/accept/make connections.
§Usage
You must provide:
- A peer request handler, which is given to each connection
- A core sync service, which keeps track of the sync state of our node