pub trait PeerToPeerPort {
    // Required methods
    fn height_stream(&self) -> BoxStream<BlockHeight>;
    fn get_sealed_block_header<'life0, 'async_trait>(
        &'life0 self,
        height: BlockHeight
    ) -> Pin<Box<dyn Future<Output = Result<Option<SourcePeer<SealedBlockHeader>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transactions<'life0, 'async_trait>(
        &'life0 self,
        block_id: SourcePeer<BlockId>
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Transaction>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
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_header<'life0, 'async_trait>( &'life0 self, height: BlockHeight ) -> Pin<Box<dyn Future<Output = Result<Option<SourcePeer<SealedBlockHeader>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Request sealed block header from the network at the given height.

Returns the source peer this header was received from.

source

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

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

Implementors§