Trait fuel_core_sync::ports::PeerToPeerPort

source ·
pub trait PeerToPeerPort {
    // Required methods
    fn height_stream(&self) -> BoxStream<BlockHeight>;
    fn get_sealed_block_headers<'life0, 'async_trait>(
        &'life0 self,
        block_height_range: Range<u32>,
    ) -> Pin<Box<dyn Future<Output = Result<SourcePeer<Option<Vec<SealedBlockHeader>>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transactions<'life0, 'async_trait>(
        &'life0 self,
        block_ids: SourcePeer<Range<u32>>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Transactions>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn report_peer(&self, peer: PeerId, report: PeerReportReason) -> Result<()>;
}
Expand description

Port for communication with the network.

Required Methods§

source

fn height_stream(&self) -> BoxStream<BlockHeight>

Stream of newly observed block heights.

source

fn get_sealed_block_headers<'life0, 'async_trait>( &'life0 self, block_height_range: Range<u32>, ) -> Pin<Box<dyn Future<Output = Result<SourcePeer<Option<Vec<SealedBlockHeader>>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request a range of sealed block headers from the network.

source

fn get_transactions<'life0, 'async_trait>( &'life0 self, block_ids: SourcePeer<Range<u32>>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Transactions>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request transactions from the network for the given block and source peer.

source

fn report_peer(&self, peer: PeerId, report: PeerReportReason) -> Result<()>

Report a peer for some reason to modify their reputation.

Implementors§