Type Alias sc_service::TFullBackend

source ·
pub type TFullBackend<TBl> = Backend<TBl>;
Expand description

Full client backend type.

Aliased Type§

struct TFullBackend<TBl> { /* private fields */ }

Implementations

source§

impl<Block> Backend<Block>
where Block: Block,

source

pub fn new( db_config: DatabaseSettings, canonicalization_delay: u64, ) -> Result<Backend<Block>, Error>

Create a new instance of database backend.

The pruning window is how old a block must be before the state is pruned.

source

pub fn reset_trie_cache(&self)

Reset the shared trie cache.

Trait Implementations

source§

impl<Block> AuxStore for Backend<Block>
where Block: Block,

source§

fn insert_aux<'a, 'b, 'c, I, D>( &self, insert: I, delete: D, ) -> Result<(), Error>
where 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>,

Insert auxiliary data into key-value store. Read more
source§

fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>

Query auxiliary data from key-value store.
source§

impl<Block> Backend<Block> for Backend<Block>
where Block: Block,

§

type BlockImportOperation = BlockImportOperation<Block>

Associated block insertion operation type.
§

type Blockchain = BlockchainDb<Block>

Associated blockchain backend type.
§

type State = RecordStatsState<RefTrackingState<Block>, Block>

Associated state backend type.
§

type OffchainStorage = LocalStorage

Offchain workers local storage.
source§

fn begin_operation( &self, ) -> Result<<Backend<Block> as Backend<Block>>::BlockImportOperation, Error>

Begin a new block insertion transaction with given parent block id. Read more
source§

fn begin_state_operation( &self, operation: &mut <Backend<Block> as Backend<Block>>::BlockImportOperation, block: <Block as Block>::Hash, ) -> Result<(), Error>

Note an operation to contain state transition.
source§

fn commit_operation( &self, operation: <Backend<Block> as Backend<Block>>::BlockImportOperation, ) -> Result<(), Error>

Commit block insertion.
source§

fn finalize_block( &self, hash: <Block as Block>::Hash, justification: Option<([u8; 4], Vec<u8>)>, ) -> Result<(), Error>

Finalize block with given hash. Read more
source§

fn append_justification( &self, hash: <Block as Block>::Hash, justification: ([u8; 4], Vec<u8>), ) -> Result<(), Error>

Append justification to the block with the given hash. Read more
source§

fn offchain_storage( &self, ) -> Option<<Backend<Block> as Backend<Block>>::OffchainStorage>

Returns a handle to offchain storage.
source§

fn usage_info(&self) -> Option<UsageInfo>

Returns current usage statistics.
source§

fn revert( &self, n: <<Block as Block>::Header as Header>::Number, revert_finalized: bool, ) -> Result<(<<Block as Block>::Header as Header>::Number, HashSet<<Block as Block>::Hash>), Error>

Attempts to revert the chain by n blocks. If revert_finalized is set it will attempt to revert past any finalized block, this is unsafe and can potentially leave the node in an inconsistent state. All blocks higher than the best block are also reverted and not counting towards n. Read more
source§

fn remove_leaf_block(&self, hash: <Block as Block>::Hash) -> Result<(), Error>

Discard non-best, unfinalized leaf block.
source§

fn blockchain(&self) -> &BlockchainDb<Block>

Returns reference to blockchain backend.
source§

fn state_at( &self, hash: <Block as Block>::Hash, ) -> Result<<Backend<Block> as Backend<Block>>::State, Error>

Returns state backend with post-state of given block.
source§

fn have_state_at( &self, hash: <Block as Block>::Hash, number: <<Block as Block>::Header as Header>::Number, ) -> bool

Returns true if state for given block is available.
source§

fn get_import_lock(&self) -> &RwLock<RawRwLock, ()>

Gain access to the import lock around this backend. Read more
source§

fn requires_full_sync(&self) -> bool

Tells whether the backend requires full-sync mode.
source§

fn pin_block(&self, hash: <Block as Block>::Hash) -> Result<(), Error>

Pin the block to keep body, justification and state available after pruning. Number of pins are reference counted. Users need to make sure to perform one call to Self::unpin_block per call to Self::pin_block.
source§

fn unpin_block(&self, hash: <Block as Block>::Hash)

Unpin the block to allow pruning.
source§

fn insert_aux<'a, 'b, 'c, I, D>( &self, insert: I, delete: D, ) -> Result<(), Error>
where 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>,

Insert auxiliary data into key-value store.
source§

fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>

Query auxiliary data from key-value store.
source§

impl<Block> LocalBackend<Block> for Backend<Block>
where Block: Block,