pub struct Client { /* private fields */ }
Expand description

Blockchain database client backed by a persistent database. Owns and manages a blockchain and a block queue. Call import_block() to import a block asynchronously; flush_queue() flushes the queue.

Implementations

Create a new client with given parameters. The database is assumed to have been initialized with the correct columns.

signals shutdown of application. We do cleanup here.

Wakes up client if it’s a sleep.

Adds an actor to be notified on certain events

Returns engine reference.

Register an action to be done if a mode/spec_name change happens.

Flush the block import queue.

The env info as of the best block.

The env info as of a given block. returns None if the block unknown.

This is triggered by a message coming from a block queue when the block is ready for insertion

Replace io channel. Useful for testing.

Get a copy of the best block’s state.

Attempt to get a copy of a specific block’s final state.

This will not fail if given BlockId::Latest. Otherwise, this can fail (but may not) if the DB prunes state or the block is unknown.

Attempt to get a copy of a specific block’s beginning state.

This will not fail if given BlockId::Latest. Otherwise, this can fail (but may not) if the DB prunes state.

Get a copy of the best block’s state.

Get info on the cache.

Get the report.

Tick the client.

Take a snapshot at the given block. If the ID given is “latest”, this will default to 1000 blocks behind.

Ask the client what the history parameter is.

Trait Implementations

Returns a list of blocks that were recently not imported because they were invalid.

Get address balance at the given block’s state. Read more

Get address balance at the latest block’s state.

Replays a given transaction for inspection.

Replays all the transactions in a given block for inspection.

Get the mode.

Disable the client from importing blocks. This cannot be undone in this session and indicates that a subsystem has reason to believe this executable incapable of syncing the chain. Read more

Set the mode.

Get the chain spec name.

Returns true if the given block is known and in the canon chain.

Set the chain via a spec name.

Look up the block number for the given block ID.

Get raw block body data by block id. Block body is an RLP list of two items: uncles and transactions. Read more

Get block status by block header hash.

Returns true, if underlying import queue is processing possible fork at the moment

Get block total difficulty.

Attempt to get address storage root at given block. May not fail on BlockId::Latest. Read more

Get block hash.

Get address code at given block’s state.

Get address code hash at given block’s state. Get value of the storage at given position at the given block’s state. Read more

Get a list of all accounts in the block id, if fat DB is in operation, otherwise None. If after is set the list starts with the following item. Read more

Get a list of all storage keys in the block id, if fat DB is in operation, otherwise None. If after is set the list starts with the following item. Read more

Get transaction with given hash.

Get pool transaction with a given hash.

Get uncle with given id.

Get transaction receipt with given hash.

Get localized receipts for all transaction in given block.

Get a tree route between from and to. See BlockChain::tree_route. Read more

Get all possible uncle hashes for a block.

Get block receipts data by block header hash.

Get block queue information.

Returns true if block queue is empty.

Clear block queue and abort all import activity.

Get the registrar address, if it exists.

Returns logs matching given filter. If one of the filtering block cannot be found, returns the block id that caused the error.

Returns traces matching given filter.

Returns trace with given id.

Returns traces created by transaction.

Returns traces created by transaction from block.

Get last hashes starting from best block.

List all ready transactions that should be propagated to other peers.

Get verified transaction with specified transaction hash.

Get the preferred chain ID to sign on

Returns engine-related extra info for BlockId.

Returns engine-related extra info for UncleId.

Returns information about pruning/data availability.

Returns a transaction signed with the key configured in the engine signer.

Schedule state-altering transaction to be executed on the next pending block with the given gas and nonce parameters. Read more

Get the address of the registry itself.

Get latest state node

Get address code at the latest block’s state.

Get value of the storage at given position at the latest block’s state.

Sorted list of transaction gas prices from at least last sample_size blocks.

Sorted list of transaction priority gas prices from at least last sample_size blocks.

reset to best_block - n

Get raw block header data by block id.

Get the best block header.

Get raw block data by block header hash.

Get address code hash at given block’s state.

Broadcast a block proposal.

Type representing chain state

Makes a non-persistent transaction call.

Makes multiple non-persistent but dependent transaction calls. Returns a vector of successes or a failure if any of the transaction fails. Read more

Estimates how much gas will be necessary for a call.

Like call, but with various defaults. Designed to be used for calling contracts.

Get blockchain information.

Restart the client with a new backend

Executes the destructor for this type. Read more

Make a new block and seal it.

Submit a seal for a block in the mining queue.

Broadcast a consensus message to the network.

Get the transition to the epoch the given parent hash is part of or transitions to. This will give the epoch that any children of this parent belong to. Read more

Attempt to cast the engine client to a full client.

Get a block number by ID.

Get raw block header data by block id.

Get underlying engine object

Import a block into the blockchain.

Export blocks to destination, with the given from, to and format argument. destination could be a file or stdout. If the format is hex, each block is written on a new line. For binary exports, all block data is written to the same line. Read more

Import blocks from destination, with the given format argument Source could be a file or stdout. For hex format imports, it attempts to read the blocks on a line by line basis. For binary format imports, reads the 8 byte RLP header in order to decode the block length to be read. Read more

Import sealed block. Skips all verifications.

Queue transactions for importing.

Queue block import with transaction receipts. Does no sealing and transaction validation.

Return percentage of how full is queue that handles ancient blocks. 0 if empty, 1 if full.

Queue conensus engine message.

Attempt to get address nonce at given block. May not fail on BlockId::Latest. Read more

Get address nonce at the latest block’s state.

Returns OpenBlock prepared for closing.

Prove account storage at a specific block id. Read more

Prove account existence at a specific block id. The key is the keccak hash of the account’s address. Returns a vector of raw trie nodes (in order from the root) proving the query. Read more

Prove execution of a transaction at the given block. Returns the output of the call and a vector of database items necessary to reproduce it. Read more

Get an epoch change signal by block hash.

Get the address of a particular blockchain service, if available.

Reopens an OpenBlock and updates uncles.

Returns latest schedule.

Type representing chain state

Get a copy of the best block’s state and header.

Attempt to get a copy of a specific block’s final state. Read more

Get the hash of block that contains the transaction, if any.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

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.