pub trait RpcClient: SubscriptionClientT {
Show 30 methods
// Provided methods
fn parameters(
&self,
) -> impl Future<Output = Result<VersionedParameters, Error>> + Send { ... }
fn best_block(
&self,
) -> impl Future<Output = Result<BlockDesc, Error>> + Send { ... }
fn finalized_block(
&self,
) -> impl Future<Output = Result<BlockDesc, Error>> + Send { ... }
fn parent(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<BlockDesc, Error>> + Send { ... }
fn state_root(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<StateRootHash, Error>> + Send { ... }
fn beefy_root(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<MmrPeakHash, Error>> + Send { ... }
fn statistics(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<AnyBytes, Error>> + Send { ... }
fn service_data(
&self,
header_hash: HeaderHash,
id: ServiceId,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send { ... }
fn service_value(
&self,
header_hash: HeaderHash,
id: ServiceId,
key: AnyVec,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send { ... }
fn service_preimage(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send { ... }
fn service_preimage_len(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
) -> impl Future<Output = Result<Option<u32>, Error>> + Send { ... }
fn service_request(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
len: u32,
) -> impl Future<Output = Result<Option<Vec<Slot>>, Error>> + Send { ... }
fn work_report(
&self,
hash: WorkReportHash,
) -> impl Future<Output = Result<AnyBytes, Error>> + Send { ... }
fn submit_work_package(
&self,
core: CoreIndex,
package: AnyBytes,
extrinsics: Vec<AnyBytes>,
) -> impl Future<Output = Result<(), Error>> + Send { ... }
fn submit_work_package_bundle(
&self,
core: CoreIndex,
bundle: AnyBytes,
) -> impl Future<Output = Result<(), Error>> + Send { ... }
fn work_package_status(
&self,
header_hash: HeaderHash,
hash: WorkPackageHash,
anchor: HeaderHash,
) -> impl Future<Output = Result<WorkPackageStatus, Error>> + Send { ... }
fn submit_preimage(
&self,
requester: ServiceId,
preimage: AnyBytes,
) -> impl Future<Output = Result<(), Error>> + Send { ... }
fn list_services(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<Vec<ServiceId>, Error>> + Send { ... }
fn fetch_work_package_segments(
&self,
wp_hash: WorkPackageHash,
indices: Vec<u16>,
) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send { ... }
fn fetch_segments(
&self,
segment_root: SegmentTreeRoot,
indices: Vec<u16>,
) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send { ... }
fn sync_state(
&self,
) -> impl Future<Output = Result<SyncState, Error>> + Send { ... }
fn subscribe_best_block(
&self,
) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send { ... }
fn subscribe_finalized_block(
&self,
) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send { ... }
fn subscribe_statistics(
&self,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<AnyBytes>>, Error>> + Send { ... }
fn subscribe_service_data(
&self,
id: ServiceId,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send { ... }
fn subscribe_service_value(
&self,
id: ServiceId,
key: AnyVec,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send { ... }
fn subscribe_service_preimage(
&self,
id: ServiceId,
hash: AnyHash,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send { ... }
fn subscribe_service_request(
&self,
id: ServiceId,
hash: AnyHash,
len: u32,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<Vec<Slot>>>>, Error>> + Send { ... }
fn subscribe_work_package_status(
&self,
hash: WorkPackageHash,
anchor: HeaderHash,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<WorkPackageStatus>>, Error>> + Send { ... }
fn subscribe_sync_status(
&self,
) -> impl Future<Output = Result<Subscription<SyncStatus>, Error>> + Send { ... }
}Expand description
Client implementation for the Rpc RPC API.
Provided Methods§
Sourcefn parameters(
&self,
) -> impl Future<Output = Result<VersionedParameters, Error>> + Send
fn parameters( &self, ) -> impl Future<Output = Result<VersionedParameters, Error>> + Send
Returns the chain parameters.
Sourcefn best_block(&self) -> impl Future<Output = Result<BlockDesc, Error>> + Send
fn best_block(&self) -> impl Future<Output = Result<BlockDesc, Error>> + Send
Returns the header hash and slot of the head of the “best” chain.
Sourcefn finalized_block(
&self,
) -> impl Future<Output = Result<BlockDesc, Error>> + Send
fn finalized_block( &self, ) -> impl Future<Output = Result<BlockDesc, Error>> + Send
Returns the header hash and slot of the latest finalized block.
Sourcefn parent(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<BlockDesc, Error>> + Send
fn parent( &self, header_hash: HeaderHash, ) -> impl Future<Output = Result<BlockDesc, Error>> + Send
Returns the header hash and slot of the parent of the block with the given header hash.
Sourcefn state_root(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<StateRootHash, Error>> + Send
fn state_root( &self, header_hash: HeaderHash, ) -> impl Future<Output = Result<StateRootHash, Error>> + Send
Returns the posterior state root of the block with the given header hash.
Sourcefn beefy_root(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<MmrPeakHash, Error>> + Send
fn beefy_root( &self, header_hash: HeaderHash, ) -> impl Future<Output = Result<MmrPeakHash, Error>> + Send
Returns the BEEFY root of the block with the given header hash.
Sourcefn statistics(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<AnyBytes, Error>> + Send
fn statistics( &self, header_hash: HeaderHash, ) -> impl Future<Output = Result<AnyBytes, Error>> + Send
Returns the activity statistics stored in the posterior state of the block with the given header hash.
The statistics are encoded as per the GP.
Sourcefn service_data(
&self,
header_hash: HeaderHash,
id: ServiceId,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
fn service_data( &self, header_hash: HeaderHash, id: ServiceId, ) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
Returns the storage data for the service with the given ID.
The data are encoded as per the GP. None is returned if there is no service with the
given ID.
Sourcefn service_value(
&self,
header_hash: HeaderHash,
id: ServiceId,
key: AnyVec,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
fn service_value( &self, header_hash: HeaderHash, id: ServiceId, key: AnyVec, ) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
Returns the value associated with the given service ID and key in the posterior state of the block with the given header hash.
None is returned if there is no value associated with the given service ID and key.
This method can be used to query arbitrary key-value pairs set by service accumulation logic.
Sourcefn service_preimage(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
fn service_preimage( &self, header_hash: HeaderHash, id: ServiceId, hash: AnyHash, ) -> impl Future<Output = Result<Option<AnyBytes>, Error>> + Send
Returns the preimage of the given hash, if it has been provided to the given service in the posterior state of the block with the given header hash.
None is returned if the preimage has not been provided to the given service.
Sourcefn service_preimage_len(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
) -> impl Future<Output = Result<Option<u32>, Error>> + Send
fn service_preimage_len( &self, header_hash: HeaderHash, id: ServiceId, hash: AnyHash, ) -> impl Future<Output = Result<Option<u32>, Error>> + Send
Same as service_preimage but only returns the length of the
preimage.
Sourcefn service_request(
&self,
header_hash: HeaderHash,
id: ServiceId,
hash: AnyHash,
len: u32,
) -> impl Future<Output = Result<Option<Vec<Slot>>, Error>> + Send
fn service_request( &self, header_hash: HeaderHash, id: ServiceId, hash: AnyHash, len: u32, ) -> impl Future<Output = Result<Option<Vec<Slot>>, Error>> + Send
Returns the preimage request associated with the given service ID and hash/length in the posterior state of the block with the given header hash.
None is returned if the preimage with the given hash/length has neither been requested by
nor provided to the given service. An empty list is returned if the preimage has been
requested, but not yet provided. A non-empty list means that the preimage has been
provided; the meaning of the slots in the list is as follows:
- The first slot is the slot in which the preimage was provided.
- The second slot, if present, is the slot in which the preimage was “forgotten”.
- The third slot, if present, is the slot in which the preimage was requested again.
Sourcefn work_report(
&self,
hash: WorkReportHash,
) -> impl Future<Output = Result<AnyBytes, Error>> + Send
fn work_report( &self, hash: WorkReportHash, ) -> impl Future<Output = Result<AnyBytes, Error>> + Send
Returns the work-report with the given hash.
The work-report is encoded as per the GP.
Sourcefn submit_work_package(
&self,
core: CoreIndex,
package: AnyBytes,
extrinsics: Vec<AnyBytes>,
) -> impl Future<Output = Result<(), Error>> + Send
fn submit_work_package( &self, core: CoreIndex, package: AnyBytes, extrinsics: Vec<AnyBytes>, ) -> impl Future<Output = Result<(), Error>> + Send
Submit a work-package to the guarantors currently assigned to the given core.
Sourcefn submit_work_package_bundle(
&self,
core: CoreIndex,
bundle: AnyBytes,
) -> impl Future<Output = Result<(), Error>> + Send
fn submit_work_package_bundle( &self, core: CoreIndex, bundle: AnyBytes, ) -> impl Future<Output = Result<(), Error>> + Send
Submit a work-package bundle to the guarantors currently assigned to the given core.
Sourcefn work_package_status(
&self,
header_hash: HeaderHash,
hash: WorkPackageHash,
anchor: HeaderHash,
) -> impl Future<Output = Result<WorkPackageStatus, Error>> + Send
fn work_package_status( &self, header_hash: HeaderHash, hash: WorkPackageHash, anchor: HeaderHash, ) -> impl Future<Output = Result<WorkPackageStatus, Error>> + Send
Returns the status of the given work-package following execution of the block with the given header hash.
If anchor does not match the anchor of the work-package then an error or an incorrect
status may be returned. An error may be returned if anchor is too old.
Sourcefn submit_preimage(
&self,
requester: ServiceId,
preimage: AnyBytes,
) -> impl Future<Output = Result<(), Error>> + Send
fn submit_preimage( &self, requester: ServiceId, preimage: AnyBytes, ) -> impl Future<Output = Result<(), Error>> + Send
Submit a preimage which is being requested by the given service.
Note that this method does not wait for the preimage to be distributed or integrated on-chain; it returns immediately.
Sourcefn list_services(
&self,
header_hash: HeaderHash,
) -> impl Future<Output = Result<Vec<ServiceId>, Error>> + Send
fn list_services( &self, header_hash: HeaderHash, ) -> impl Future<Output = Result<Vec<ServiceId>, Error>> + Send
Returns a list of all services currently known to be on JAM.
This is a best-effort list and may not reflect the true state. Nodes could e.g. reasonably hide services which are not recently active from this list.
Sourcefn fetch_work_package_segments(
&self,
wp_hash: WorkPackageHash,
indices: Vec<u16>,
) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send
fn fetch_work_package_segments( &self, wp_hash: WorkPackageHash, indices: Vec<u16>, ) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send
Fetches a list of segments from the DA layer, exported by the work-package with the given hash.
Sourcefn fetch_segments(
&self,
segment_root: SegmentTreeRoot,
indices: Vec<u16>,
) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send
fn fetch_segments( &self, segment_root: SegmentTreeRoot, indices: Vec<u16>, ) -> impl Future<Output = Result<Vec<SegmentBytes>, Error>> + Send
Fetches a list of segments from the DA layer, exported by a work-package with the given segment root hash.
Sourcefn sync_state(&self) -> impl Future<Output = Result<SyncState, Error>> + Send
fn sync_state(&self) -> impl Future<Output = Result<SyncState, Error>> + Send
Returns the sync status of the node.
Sourcefn subscribe_best_block(
&self,
) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send
fn subscribe_best_block( &self, ) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send
Subscribe to updates of the head of the “best” chain, as returned by bestBlock.
Sourcefn subscribe_finalized_block(
&self,
) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send
fn subscribe_finalized_block( &self, ) -> impl Future<Output = Result<Subscription<BlockDesc>, Error>> + Send
Subscribe to updates of the latest finalized block, as returned by finalizedBlock.
Sourcefn subscribe_statistics(
&self,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<AnyBytes>>, Error>> + Send
fn subscribe_statistics( &self, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<AnyBytes>>, Error>> + Send
Subscribe to updates of the activity statistics stored in chain state.
The statistics are encoded as per the GP.
Sourcefn subscribe_service_data(
&self,
id: ServiceId,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
fn subscribe_service_data( &self, id: ServiceId, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
Subscribe to updates of the storage data for the service with the given ID.
The value field of updates will contain service data encoded as per the GP. It will be
None when there is no service with the given ID.
Sourcefn subscribe_service_value(
&self,
id: ServiceId,
key: AnyVec,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
fn subscribe_service_value( &self, id: ServiceId, key: AnyVec, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
Subscribe to updates of the value associated with the given service ID and key.
The value field of updates will be None when there is no value associated with the
given service ID and key.
Sourcefn subscribe_service_preimage(
&self,
id: ServiceId,
hash: AnyHash,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
fn subscribe_service_preimage( &self, id: ServiceId, hash: AnyHash, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<AnyBytes>>>, Error>> + Send
Subscribe to updates of the preimage associated with the given service ID and hash.
The value field of updates will be None if the preimage has not been provided to the
service. Otherwise, it will be the preimage of the given hash.
Sourcefn subscribe_service_request(
&self,
id: ServiceId,
hash: AnyHash,
len: u32,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<Vec<Slot>>>>, Error>> + Send
fn subscribe_service_request( &self, id: ServiceId, hash: AnyHash, len: u32, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<Option<Vec<Slot>>>>, Error>> + Send
Subscribe to updates of the preimage request associated with the given service ID and hash/length.
The value field of updates will either be None or a list of slots, with the same
semantics as serviceRequest return values.
Sourcefn subscribe_work_package_status(
&self,
hash: WorkPackageHash,
anchor: HeaderHash,
finalized: bool,
) -> impl Future<Output = Result<Subscription<ChainSubUpdate<WorkPackageStatus>>, Error>> + Send
fn subscribe_work_package_status( &self, hash: WorkPackageHash, anchor: HeaderHash, finalized: bool, ) -> impl Future<Output = Result<Subscription<ChainSubUpdate<WorkPackageStatus>>, Error>> + Send
Subscribe to status updates for the given work-package.
If anchor does not match the anchor of the work-package then the subscription may fail or
yield incorrect statuses. The subscription may fail if anchor is too old.
Sourcefn subscribe_sync_status(
&self,
) -> impl Future<Output = Result<Subscription<SyncStatus>, Error>> + Send
fn subscribe_sync_status( &self, ) -> impl Future<Output = Result<Subscription<SyncStatus>, Error>> + Send
Subscribe to changes in sync status.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".