referrerpolicy=no-referrer-when-downgrade

Trait sc_rpc_spec_v2::archive::api::ArchiveApiServer

source ·
pub trait ArchiveApiServer<Hash>: Sized + Send + Sync + 'static {
    // Required methods
    fn archive_unstable_body(
        &self,
        hash: Hash,
    ) -> RpcResult<Option<Vec<String>>>;
    fn archive_unstable_genesis_hash(&self) -> RpcResult<String>;
    fn archive_unstable_header(&self, hash: Hash) -> RpcResult<Option<String>>;
    fn archive_unstable_finalized_height(&self) -> RpcResult<u64>;
    fn archive_unstable_hash_by_height(
        &self,
        height: u64,
    ) -> RpcResult<Vec<String>>;
    fn archive_unstable_call(
        &self,
        hash: Hash,
        function: String,
        call_parameters: String,
    ) -> RpcResult<MethodResult>;
    fn archive_unstable_storage(
        &self,
        subscription_sink: PendingSubscriptionSink,
        hash: Hash,
        items: Vec<StorageQuery<String>>,
        child_trie: Option<String>,
    );
    fn archive_unstable_storage_diff(
        &self,
        subscription_sink: PendingSubscriptionSink,
        hash: Hash,
        items: Vec<ArchiveStorageDiffItem<String>>,
        previous_hash: Option<Hash>,
    );

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where Hash: Send + Sync + 'static + DeserializeOwned { ... }
}
Expand description

Server trait implementation for the ArchiveApi RPC API.

Required Methods§

source

fn archive_unstable_body(&self, hash: Hash) -> RpcResult<Option<Vec<String>>>

Retrieves the body (list of transactions) of a given block hash.

Returns an array of strings containing the hexadecimal-encoded SCALE-codec-encoded transactions in that block. If no block with that hash is found, null.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_genesis_hash(&self) -> RpcResult<String>

Get the chain’s genesis hash.

Returns a string containing the hexadecimal-encoded hash of the genesis block of the chain.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_header(&self, hash: Hash) -> RpcResult<Option<String>>

Get the block’s header.

Returns a string containing the hexadecimal-encoded SCALE-codec encoding header of the block.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_finalized_height(&self) -> RpcResult<u64>

Get the height of the current finalized block.

Returns an integer height of the current finalized block of the chain.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_hash_by_height(&self, height: u64) -> RpcResult<Vec<String>>

Get the hashes of blocks from the given height.

Returns an array (possibly empty) of strings containing an hexadecimal-encoded hash of a block header.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_call( &self, hash: Hash, function: String, call_parameters: String, ) -> RpcResult<MethodResult>

Call into the Runtime API at a specified block’s state.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_storage( &self, subscription_sink: PendingSubscriptionSink, hash: Hash, items: Vec<StorageQuery<String>>, child_trie: Option<String>, )

Returns storage entries at a specific block’s state.

§Unstable

This method is unstable and subject to change in the future.

source

fn archive_unstable_storage_diff( &self, subscription_sink: PendingSubscriptionSink, hash: Hash, items: Vec<ArchiveStorageDiffItem<String>>, previous_hash: Option<Hash>, )

Returns the storage difference between two blocks.

§Unstable

This method is unstable and can change in minor or patch releases.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>
where Hash: Send + Sync + 'static + DeserializeOwned,

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<BE, Block, Client> ArchiveApiServer<<Block as Block>::Hash> for Archive<BE, Block, Client>
where Block: BlockT + 'static, Block::Header: Unpin, BE: Backend<Block> + 'static, Client: BlockBackend<Block> + ExecutorProvider<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + BlockchainEvents<Block> + CallApiAt<Block> + StorageProvider<Block, BE> + 'static,