ckb_indexer_sync

Trait IndexerSync

Source
pub trait IndexerSync {
    // Required methods
    fn tip(&self) -> Result<Option<(BlockNumber, Byte32)>, Error>;
    fn append(&self, block: &BlockView) -> Result<(), Error>;
    fn rollback(&self) -> Result<(), Error>;
    fn get_identity(&self) -> &str;
    fn set_init_tip(&self, init_tip_number: u64, init_tip_hash: &H256);
}
Expand description

Trait for an indexer’s synchronization interface

Required Methods§

Source

fn tip(&self) -> Result<Option<(BlockNumber, Byte32)>, Error>

Retrieves the tip of the indexer

Source

fn append(&self, block: &BlockView) -> Result<(), Error>

Appends a new block to the indexer

Source

fn rollback(&self) -> Result<(), Error>

Rollback the indexer to a previous state

Source

fn get_identity(&self) -> &str

Get indexer identity

Source

fn set_init_tip(&self, init_tip_number: u64, init_tip_hash: &H256)

Set init tip

Implementors§