Trait fuel_core_p2p::service::TaskP2PService

source ·
pub trait TaskP2PService: Send {
    // Required methods
    fn get_all_peer_info(&self) -> Vec<(&PeerId, &PeerInfo)>;
    fn get_peer_id_with_height(&self, height: &BlockHeight) -> Option<PeerId>;
    fn next_event(&mut self) -> BoxFuture<'_, Option<FuelP2PEvent>>;
    fn publish_message(
        &mut self,
        message: GossipsubBroadcastRequest,
    ) -> Result<()>;
    fn send_request_msg(
        &mut self,
        peer_id: Option<PeerId>,
        request_msg: RequestMessage,
        on_response: ResponseSender,
    ) -> Result<()>;
    fn send_response_msg(
        &mut self,
        request_id: InboundRequestId,
        message: ResponseMessage,
    ) -> Result<()>;
    fn report_message(
        &mut self,
        message: GossipsubMessageInfo,
        acceptance: GossipsubMessageAcceptance,
    ) -> Result<()>;
    fn report_peer(
        &mut self,
        peer_id: PeerId,
        score: AppScore,
        reporting_service: &str,
    ) -> Result<()>;
    fn update_block_height(&mut self, height: BlockHeight) -> Result<()>;
}

Required Methods§

source

fn get_all_peer_info(&self) -> Vec<(&PeerId, &PeerInfo)>

source

fn get_peer_id_with_height(&self, height: &BlockHeight) -> Option<PeerId>

source

fn next_event(&mut self) -> BoxFuture<'_, Option<FuelP2PEvent>>

source

fn publish_message(&mut self, message: GossipsubBroadcastRequest) -> Result<()>

source

fn send_request_msg( &mut self, peer_id: Option<PeerId>, request_msg: RequestMessage, on_response: ResponseSender, ) -> Result<()>

source

fn send_response_msg( &mut self, request_id: InboundRequestId, message: ResponseMessage, ) -> Result<()>

source

fn report_message( &mut self, message: GossipsubMessageInfo, acceptance: GossipsubMessageAcceptance, ) -> Result<()>

source

fn report_peer( &mut self, peer_id: PeerId, score: AppScore, reporting_service: &str, ) -> Result<()>

source

fn update_block_height(&mut self, height: BlockHeight) -> Result<()>

Implementors§