pub trait ChainHeadApiServer<Hash>: Sized + Send + Sync + 'static {
    // Required methods
    fn chain_head_unstable_header(
        &self,
        follow_subscription: String,
        hash: Hash
    ) -> RpcResult<Option<String>>;
    fn chain_head_unstable_genesis_hash(&self) -> RpcResult<String>;
    fn chain_head_unstable_unpin(
        &self,
        follow_subscription: String,
        hash: Hash
    ) -> RpcResult<()>;
    fn chain_head_unstable_follow(
        &self,
        subscription_sink: SubscriptionSink,
        runtime_updates: bool
    ) -> SubscriptionResult;
    fn chain_head_unstable_body(
        &self,
        subscription_sink: SubscriptionSink,
        follow_subscription: String,
        hash: Hash,
        network_config: Option<NetworkConfig>
    ) -> SubscriptionResult;
    fn chain_head_unstable_storage(
        &self,
        subscription_sink: SubscriptionSink,
        follow_subscription: String,
        hash: Hash,
        key: String,
        child_key: Option<String>,
        network_config: Option<NetworkConfig>
    ) -> SubscriptionResult;
    fn chain_head_unstable_call(
        &self,
        subscription_sink: SubscriptionSink,
        follow_subscription: String,
        hash: Hash,
        function: String,
        call_parameters: String,
        network_config: Option<NetworkConfig>
    ) -> SubscriptionResult;

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

Server trait implementation for the ChainHeadApi RPC API.

Required Methods§

source

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

Retrieves the header of a pinned block.

This method should be seen as a complement to chainHead_unstable_follow, allowing the JSON-RPC client to retrieve more information about a block that has been reported.

Use archive_unstable_header if instead you want to retrieve the header of an arbitrary block.

Unstable

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

source

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

Get the chain’s genesis hash.

Unstable

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

source

fn chain_head_unstable_unpin( &self, follow_subscription: String, hash: Hash ) -> RpcResult<()>

Unpin a block reported by the follow method.

Ongoing operations that require the provided block will continue normally.

Unstable

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

source

fn chain_head_unstable_follow( &self, subscription_sink: SubscriptionSink, runtime_updates: bool ) -> SubscriptionResult

Track the state of the head of the chain: the finalized, non-finalized, and best blocks.

Unstable

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

source

fn chain_head_unstable_body( &self, subscription_sink: SubscriptionSink, follow_subscription: String, hash: Hash, network_config: Option<NetworkConfig> ) -> SubscriptionResult

Retrieves the body (list of transactions) of a pinned block.

This method should be seen as a complement to chainHead_unstable_follow, allowing the JSON-RPC client to retrieve more information about a block that has been reported.

Use archive_unstable_body if instead you want to retrieve the body of an arbitrary block.

Unstable

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

source

fn chain_head_unstable_storage( &self, subscription_sink: SubscriptionSink, follow_subscription: String, hash: Hash, key: String, child_key: Option<String>, network_config: Option<NetworkConfig> ) -> SubscriptionResult

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

Unstable

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

source

fn chain_head_unstable_call( &self, subscription_sink: SubscriptionSink, follow_subscription: String, hash: Hash, function: String, call_parameters: String, network_config: Option<NetworkConfig> ) -> SubscriptionResult

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

Unstable

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

Provided Methods§

source

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

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

Implementors§

source§

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