ChainDataStore

Trait ChainDataStore 

Source
pub trait ChainDataStore: Send + Sync {
    // Required methods
    fn get_highest_beacon<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<ChainPoint>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_highest_block_range<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<BlockRange>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store_blocks_and_transactions<'life0, 'async_trait>(
        &'life0 self,
        block_with_transactions: Vec<CardanoBlockWithTransactions>,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transactions_in_range<'life0, 'async_trait>(
        &'life0 self,
        range: Range<BlockNumber>,
    ) -> Pin<Box<dyn Future<Output = StdResult<Vec<CardanoTransaction>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store_block_range_roots<'life0, 'async_trait>(
        &'life0 self,
        block_ranges: Vec<(BlockRange, MKTreeNode)>,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_rolled_chain_data_and_block_range<'life0, 'async_trait>(
        &'life0 self,
        slot_number: SlotNumber,
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Cardano chain data store

Required Methods§

Source

fn get_highest_beacon<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StdResult<Option<ChainPoint>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the highest known transaction beacon

Source

fn get_highest_block_range<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StdResult<Option<BlockRange>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the highest stored block range root bounds

Source

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

Store the given blocks and their transactions

Source

fn get_transactions_in_range<'life0, 'async_trait>( &'life0 self, range: Range<BlockNumber>, ) -> Pin<Box<dyn Future<Output = StdResult<Vec<CardanoTransaction>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get transactions in an interval of blocks

Source

fn store_block_range_roots<'life0, 'async_trait>( &'life0 self, block_ranges: Vec<(BlockRange, MKTreeNode)>, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store list of block ranges with their corresponding merkle root

Source

fn remove_rolled_chain_data_and_block_range<'life0, 'async_trait>( &'life0 self, slot_number: SlotNumber, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove blocks, transactions, and block range roots that are in a rolled-back fork

  • Remove blocks and transactions with a slot number strictly greater than the given slot number
  • Remove block range roots that have lower bound range strictly above the given slot number

Implementors§