Trait sc_rpc::state::StateBackend[][src]

pub trait StateBackend<Block: BlockT, Client>: Send + Sync + 'static where
    Block: BlockT + 'static,
    Client: Send + Sync + 'static, 
{
Show methods fn call(
        &self,
        block: Option<Block::Hash>,
        method: String,
        call_data: Bytes
    ) -> FutureResult<Bytes>;
fn storage_keys(
        &self,
        block: Option<Block::Hash>,
        prefix: StorageKey
    ) -> FutureResult<Vec<StorageKey>>;
fn storage_pairs(
        &self,
        block: Option<Block::Hash>,
        prefix: StorageKey
    ) -> FutureResult<Vec<(StorageKey, StorageData)>>;
fn storage_keys_paged(
        &self,
        block: Option<Block::Hash>,
        prefix: Option<StorageKey>,
        count: u32,
        start_key: Option<StorageKey>
    ) -> FutureResult<Vec<StorageKey>>;
fn storage(
        &self,
        block: Option<Block::Hash>,
        key: StorageKey
    ) -> FutureResult<Option<StorageData>>;
fn storage_hash(
        &self,
        block: Option<Block::Hash>,
        key: StorageKey
    ) -> FutureResult<Option<Block::Hash>>;
fn storage_size(
        &self,
        block: Option<Block::Hash>,
        key: StorageKey
    ) -> FutureResult<Option<u64>>;
fn metadata(&self, block: Option<Block::Hash>) -> FutureResult<Bytes>;
fn runtime_version(
        &self,
        block: Option<Block::Hash>
    ) -> FutureResult<RuntimeVersion>;
fn query_storage(
        &self,
        from: Block::Hash,
        to: Option<Block::Hash>,
        keys: Vec<StorageKey>
    ) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>;
fn query_storage_at(
        &self,
        keys: Vec<StorageKey>,
        at: Option<Block::Hash>
    ) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>;
fn read_proof(
        &self,
        block: Option<Block::Hash>,
        keys: Vec<StorageKey>
    ) -> FutureResult<ReadProof<Block::Hash>>;
fn subscribe_runtime_version(
        &self,
        _meta: Metadata,
        subscriber: Subscriber<RuntimeVersion>
    );
fn unsubscribe_runtime_version(
        &self,
        _meta: Option<Metadata>,
        id: SubscriptionId
    ) -> RpcResult<bool>;
fn subscribe_storage(
        &self,
        _meta: Metadata,
        subscriber: Subscriber<StorageChangeSet<Block::Hash>>,
        keys: Option<Vec<StorageKey>>
    );
fn unsubscribe_storage(
        &self,
        _meta: Option<Metadata>,
        id: SubscriptionId
    ) -> RpcResult<bool>;
fn trace_block(
        &self,
        block: Block::Hash,
        targets: Option<String>,
        storage_keys: Option<String>
    ) -> FutureResult<TraceBlockResponse>;
}
Expand description

State backend API.

Required methods

Call runtime method at given block.

Returns the keys with prefix, leave empty to get all the keys.

Returns the keys with prefix along with their values, leave empty to get all the pairs.

Returns the keys with prefix with pagination support.

Returns a storage entry at a specific block’s state.

Returns the hash of a storage entry at a block’s state.

Returns the size of a storage entry at a block’s state.

If data is available at key, it is returned. Else, the sum of values who’s key has key prefix is returned, i.e. all the storage (double) maps that have this prefix.

Returns the runtime metadata as an opaque blob.

Get the runtime version.

Query historical storage entries (by key) starting from a block given as the second parameter.

NOTE This first returned result contains the initial state of storage for all keys. Subsequent values in the vector represent changes to the previous state (diffs).

Query storage entries (by key) starting at block hash given as the second parameter.

Returns proof of storage entries at a specific block’s state.

New runtime version subscription

Unsubscribe from runtime version subscription

New storage subscription

Unsubscribe from storage subscription

Trace storage changes for block

Implementors