/// main function. start a p2p service.
main function. start a p2p service.
main function . start a p2p service .
pub async fn start(
        config: Config,
    ) -> Result<(PeerId, Sender<SendMessage>, Receiver<ReceiveMessage>)> {
        info!("start p2p service...");
        let (send_send, send_recv) = new_send_channel();
        let (recv_send, recv_recv) = new_receive_channel();
        let peer_id = super::server::start(config, recv_send, send_recv).await?;
        info!("start p2p ok.");
        Ok((peer_id, send_send, recv_recv))
    }
pub async fn start ( config : Config , ) -> Result < ( PeerId , Sender < SendMessage > , Receiver < ReceiveMessage > ) > { info ! ( " " ) ; let ( send_send , send_recv ) = new_send_channel ( ) ; let ( recv_send , recv_recv ) = new_receive_channel ( ) ; let peer_id = super :: server :: start ( config , recv_send , send_recv ) . await ? ; info ! ( " " ) ; Ok ( ( peer_id , send_send , recv_recv ) ) }
main function.
main function .
config
Config