Struct sc_service::client::Client[][src]

pub struct Client<B, E, Block, RA> where
    Block: BlockT
{ /* fields omitted */ }
Expand description

Substrate Client

Implementations

Creates new Substrate Client with given blockchain and code executor.

returns a reference to the block import notification sinks useful for test environments.

returns a reference to the finality notification sinks useful for test environments.

Get a reference to the state at a given block.

Get the code at a given block.

Get the RuntimeVersion at a given block.

Reads given header and generates CHT-based header proof for CHT of given size.

Does the same work as key_changes_proof, but assumes that CHTs are of passed size.

Attempts to revert the chain by n blocks guaranteeing that no block is reverted past the last finalized block. Returns the number of blocks that were successfully reverted.

Attempts to revert the chain by n blocks disregarding finality. This method will revert any finalized blocks as requested and can potentially leave the node in an inconsistent state. Other modules in the system that persist data and that rely on finality (e.g. consensus parts) will be unaffected by the revert. Use this method with caution and making sure that no other data needs to be reverted for consistency aside from the block data. If blacklist is set to true, will also blacklist reverted blocks from finalizing again. The blacklist is reset upon client restart.

Returns the number of blocks that were successfully reverted.

Get blockchain info.

Get block status.

Get block header by id.

Get block body by id.

Gets the uncles of the block with target_hash going back max_generation ancestors.

Trait Implementations

Insert auxiliary data into key-value store.

Query auxiliary data from key-value store.

Insert auxiliary data into key-value store. Read more

Query auxiliary data from key-value store.

Get block body by ID. Returns None if the body is not stored.

Get full block by id.

Get block status.

Get block justifications for the block with the given id.

Get block hash by number.

Get single indexed transaction by content hash. Read more

Check if transaction index exists.

Get all indexed transactions for a block, including renewed transactions. Read more

Create a new block, built on top of parent. Read more

Create a new block, built on the head of the chain.

The error type that will be returned by the functions.

Convert the given block_id to the corresponding block hash.

Convert the given block_id to the corresponding block number.

NOTE: only use this implementation when you are sure there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.

Import a checked and validated block. If a justification is provided in BlockImportParams then finalized must be true.

NOTE: only use this implementation when there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.

If you are not sure that there are no BlockImport objects provided by the consensus algorithm, don’t use this function.

Check block preconditions.

The error type.

The transaction type used by the backend.

The error type.

The transaction type used by the backend.

Import a block. Read more

Check block preconditions.

The type of the block.

Get block import event stream.

Get storage changes event stream.

Get a stream of finality notifications. Not guaranteed to be fired for every finalized block. Read more

The state backend that is used to store the block states.

Calls the given api function with the given encoded arguments at the given block and returns the encoded result. Read more

Returns the runtime version at the given block.

Retrieve the status of the block denoted by the given BlockId.

executor instance

Get call executor reference.

Get a reference to the execution extensions.

Mark all blocks up to given as finalized in operation. Read more

Finalize a block. Read more

Mark all blocks up to given as finalized in operation. Read more

Finalize a block. Read more

Get block header. Returns None if block is not found.

Get blockchain info.

Get block status.

Get block number by hash. Returns None if the header is not in the chain.

Get block hash by number. Returns None if the header is not in the chain.

Convert an arbitrary block ID into a block hash.

Convert an arbitrary block ID into a block hash.

Get block header. Returns UnknownBlock error if block is not found.

Convert an arbitrary block ID into a block number. Returns UnknownBlock error if block is not found. Read more

Convert an arbitrary block ID into a block hash. Returns UnknownBlock error if block is not found. Read more

Get block header. Returns None if block is not found.

Get blockchain info.

Get block status.

Get block number by hash. Returns None if the header is not in the chain.

Get block hash by number. Returns None if the header is not in the chain.

Convert an arbitrary block ID into a block hash.

Convert an arbitrary block ID into a block hash.

Get block header. Returns UnknownBlock error if block is not found.

Convert an arbitrary block ID into a block number. Returns UnknownBlock error if block is not found. Read more

Convert an arbitrary block ID into a block hash. Returns UnknownBlock error if block is not found. Read more

Error used in case the header metadata is not found.

Get all indexed transactions for a block, including renewed transactions. Read more

Get block number for a block hash.

Lock the import lock, and run operations inside.

Lock the import lock, and run operations inside.

Reads storage value at a given block + key, returning read proof.

Reads child storage value at a given block + storage_key + key, returning read proof. Read more

Execute a call to a contract on top of state in a block of given hash AND returning execution proof. Read more

Reads given header and generates CHT-based header proof.

Get proof for computation of (block, extrinsic) pairs where key has been changed at given blocks range. min is the hash of the first block, which changes trie root is known to the requester - when we’re using changes tries from ascendants of this block, we should provide proofs for changes tries roots max is the hash of the last block known to the requester - we can’t use changes tries from descendants of this block. Works only for runtimes that are supporting changes tries. Read more

Given a BlockId iterate over all storage values starting at start_key exclusively, building proofs until size limit is reached. Returns combined proof and the number of collected keys. Read more

Given a BlockId iterate over all storage values starting at start_key. Returns collected keys and values. Read more

Verify read storage proof for a set of keys. Returns collected key-value pairs and a flag indicating if iteration is complete. Read more

Returns data cache reference, if it is enabled on this backend.

The concrete type that provides the api.

Returns the runtime api. The returned instance will keep track of modifications to the storage. Any successful call to an api function, will commit its changes to an internal buffer. Otherwise, the modifications will be discarded. The modifications will not be applied to the storage, even on a commit. Read more

Gets the uncles of the block with target_hash going back max_generation ancestors.

Given a BlockId and a key prefix, return the matching storage keys in that block.

Given a BlockId and a key prefix, return the matching child storage keys and values in that block. Read more

Given a BlockId and a key prefix, return a KeyIterator iterates matching storage keys in that block. Read more

Given a BlockId and a key prefix and a child storage key, return a KeyIterator that iterates matching storage keys in that block. Read more

Given a BlockId and a key, return the value under the key in that block.

Given a BlockId and a key, return the value under the hash in that block.

Given a BlockId, a key prefix, and a child storage key, return the matching child storage keys. Read more

Given a BlockId, a key and a child storage key, return the value under the key in that block. Read more

Given a BlockId, a key and a child storage key, return the hash under the key in that block. Read more

Get longest range within [first; last] that is possible to use in key_changes and key_changes_proof calls. Range could be shortened from the beginning if some changes tries have been pruned. Returns Ok(None) if changes tries are not supported. Read more

Get pairs of (block, extrinsic) where key has been changed at given blocks range. Works only for runtimes that are supporting changes tries. Read more

Get usage info about current client.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more