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,
impl<Block> Backend<Block>where
Block: Block,
sourcepub fn new(
db_config: DatabaseSettings,
canonicalization_delay: u64,
) -> Result<Backend<Block>, Error>
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.
sourcepub fn reset_trie_cache(&self)
pub fn reset_trie_cache(&self)
Reset the shared trie cache.
Trait Implementations
source§impl<Block> AuxStore for Backend<Block>where
Block: Block,
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]>,
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§impl<Block> Backend<Block> for Backend<Block>where
Block: Block,
impl<Block> Backend<Block> for Backend<Block>where
Block: Block,
§type BlockImportOperation = BlockImportOperation<Block>
type BlockImportOperation = BlockImportOperation<Block>
Associated block insertion operation type.
§type Blockchain = BlockchainDb<Block>
type Blockchain = BlockchainDb<Block>
Associated blockchain backend type.
§type State = RecordStatsState<RefTrackingState<Block>, Block>
type State = RecordStatsState<RefTrackingState<Block>, Block>
Associated state backend type.
§type OffchainStorage = LocalStorage
type OffchainStorage = LocalStorage
Offchain workers local storage.
source§fn begin_operation(
&self,
) -> Result<<Backend<Block> as Backend<Block>>::BlockImportOperation, Error>
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>
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>
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>
fn finalize_block( &self, hash: <Block as Block>::Hash, justification: Option<([u8; 4], Vec<u8>)>, ) -> Result<(), Error>
Finalize block with given
hash
. Read moresource§fn append_justification(
&self,
hash: <Block as Block>::Hash,
justification: ([u8; 4], Vec<u8>),
) -> Result<(), Error>
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 moresource§fn offchain_storage(
&self,
) -> Option<<Backend<Block> as Backend<Block>>::OffchainStorage>
fn offchain_storage( &self, ) -> Option<<Backend<Block> as Backend<Block>>::OffchainStorage>
Returns a handle to offchain storage.
source§fn usage_info(&self) -> Option<UsageInfo>
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>
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 moresource§fn remove_leaf_block(&self, hash: <Block as Block>::Hash) -> Result<(), Error>
fn remove_leaf_block(&self, hash: <Block as Block>::Hash) -> Result<(), Error>
Discard non-best, unfinalized leaf block.
source§fn blockchain(&self) -> &BlockchainDb<Block>
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>
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
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, ()>
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
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>
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)
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]>,
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.