Trait ChainTrack

Source
pub trait ChainTrack: Sync + Send {
    // Required methods
    fn log_prefix(&self) -> String;
    fn id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn heartbeat_pubkey<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = PublicKey> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn network(&self) -> Network;
    fn tip_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = (u32, BlockHash)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn forward_watches<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = (Vec<Txid>, Vec<OutPoint>)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reverse_watches<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = (Vec<Txid>, Vec<OutPoint>)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_block<'life0, 'async_trait>(
        &'life0 self,
        header: BlockHeader,
        proof: TxoProof,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_block<'life0, 'async_trait>(
        &'life0 self,
        proof: TxoProof,
        prev_headers: Headers,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn beat<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = SignedHeartbeat> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

ChainTracker interface

Required Methods§

Source

fn log_prefix(&self) -> String

Identity string for the log

Source

fn id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Full identity

Source

fn heartbeat_pubkey<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = PublicKey> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The heartbeat public key

Source

fn network(&self) -> Network

Returns the network

Source

fn tip_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = (u32, BlockHash)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the block height and hash of specified node’s chaintracker tip

Source

fn forward_watches<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = (Vec<Txid>, Vec<OutPoint>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns all Txid and OutPoints to watch for in future blocks

Source

fn reverse_watches<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = (Vec<Txid>, Vec<OutPoint>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns all Txid and OutPoint watches used for prior blocks (used when removing)

Source

fn add_block<'life0, 'async_trait>( &'life0 self, header: BlockHeader, proof: TxoProof, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a block to the tracker

Source

fn remove_block<'life0, 'async_trait>( &'life0 self, proof: TxoProof, prev_headers: Headers, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove block at tip due to reorg

Source

fn beat<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SignedHeartbeat> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Produce a signed heartbeat for the signer node

Implementors§