Crate sc_sync_state_rpc

Source
Expand description

A RPC handler to create sync states for light clients.

Currently only usable with BABE + GRANDPA.

§Usage

To use the light sync state, it needs to be added as an extension to the chain spec:

use sc_sync_state_rpc::LightSyncStateExtension;

#[derive(Default, Clone, serde::Serialize, serde::Deserialize, sc_chain_spec::ChainSpecExtension)]
#[serde(rename_all = "camelCase")]
pub struct Extensions {
   light_sync_state: LightSyncStateExtension,
}

type ChainSpec = sc_chain_spec::GenericChainSpec<(), Extensions>;

If the LightSyncStateExtension is not added as an extension to the chain spec, the SyncState will fail at instantiation.

Structs§

LightSyncState
Hardcoded information that allows light clients to sync quickly.
SyncState
An api for sync state RPC calls.

Enums§

Error
Error type used by this crate.

Traits§

SyncStateApiClient
Client implementation for the SyncStateApi RPC API.
SyncStateApiServer
Server trait implementation for the SyncStateApi RPC API.

Type Aliases§

LightSyncStateExtension
The light sync state extension.