referrerpolicy=no-referrer-when-downgrade

Trait sc_rpc_spec_v2::chain_head::api::ChainHeadApiServer

source ·
pub trait ChainHeadApiServer<Hash>: Sized + Send + Sync + 'static {
    // Required methods
    fn chain_head_unstable_body<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        hash: Hash,
    ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_header<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        hash: Hash,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_storage<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        hash: Hash,
        items: Vec<StorageQuery<String>>,
        child_trie: Option<String>,
    ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        hash: Hash,
        function: String,
        call_parameters: String,
    ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_unpin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        hash_or_hashes: ListOrValue<Hash>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_continue<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        operation_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_stop_operation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        follow_subscription: String,
        operation_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn chain_head_unstable_follow(
        &self,
        subscription_sink: PendingSubscriptionSink,
        with_runtime: bool,
    );

    // 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_body<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, hash: Hash, ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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

This method should be seen as a complement to chainHead_v1_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_header<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, hash: Hash, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves the header of a pinned block.

This method should be seen as a complement to chainHead_v1_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_storage<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, hash: Hash, items: Vec<StorageQuery<String>>, child_trie: Option<String>, ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns storage entries at a specific block’s state.

§Unstable

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

source

fn chain_head_unstable_call<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, hash: Hash, function: String, call_parameters: String, ) -> Pin<Box<dyn Future<Output = ResponsePayload<'static, MethodResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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 chain_head_unstable_unpin<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, hash_or_hashes: ListOrValue<Hash>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unpin a block or multiple blocks reported by the follow method.

Ongoing operations that require the provided block will continue normally.

When this method returns an error, it is guaranteed that no blocks have been unpinned.

§Unstable

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

source

fn chain_head_unstable_continue<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, operation_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resumes a storage fetch started with chainHead_storage after it has generated an operationWaitingForContinue event.

§Unstable

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

source

fn chain_head_unstable_stop_operation<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, follow_subscription: String, operation_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stops an operation started with chainHead_v1_body, chainHead_v1_call, or chainHead_v1_storage. If the operation was still in progress, this interrupts it. If the operation was already finished, this call has no effect.

§Unstable

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

source

fn chain_head_unstable_follow( &self, subscription_sink: PendingSubscriptionSink, with_runtime: bool, )

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.

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.

Object Safety§

This trait is not object safe.

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 = Error> + BlockchainEvents<Block> + CallApiAt<Block> + StorageProvider<Block, BE> + 'static,