Expand description
§Casper client library
The crate provides functions for interacting with a Casper network.
Most of the functions involve sending a JSON-RPC request to a specified node on the chosen network, and providing the RPC response.
§Common Parameters
Many of the functions have similar parameters. Descriptions for these common ones follow:
rpc_id: JsonRpcId- The JSON-RPC identifier, applied to the request and returned in the response.node_address: &str- The hostname or IP and port of the server, e.g.http://127.0.0.1:7777.verbosity: Verbosity- WhenLow, nothing is printed to stdout. ForMedium, the request and response are printed tostdoutwith long string fields (e.g. hex-formatted raw Wasm bytes) shortened to a string indicating the char count of the field.Highverbosity is the same asMediumexcept without abbreviation of long fields.maybe_block_identifier: Option<BlockIdentifier>- The identifier of theBlockto use, either block height or block hash. IfNone, the latestBlockknown on the server will be used.
Modules§
- cli
- An API suitable for use by a CLI binary.
- keygen
- Cryptographic key generation.
- rpcs
- The JSON-RPC request and response types.
- types
- Various data types of the Casper network.
Structs§
- Success
Response - A successful response to a JSON-RPC request.
Enums§
- Error
- Errors that may be returned by
casper_clientfunctions. - Json
RpcId - An identifier for a JSON-RPC, provided by the client and returned in the response.
- Output
Kind - An output abstraction for associating a
Writeobject with some metadata. - Validate
Response Error - Error that can be returned when validating data returned from a JSON-RPC method.
- Verbosity
- The level of verbosity of the output to stdout.
Constants§
- MAX_
SERIALIZED_ SIZE_ OF_ DEPLOY - The maximum permissible size in bytes of a Deploy when serialized via
ToBytes.
Functions§
- build_
archive - Builds an archive from the specified path.
- get_
account - Retrieves an
Accountat a givenBlock. - get_
auction_ info - Retrieves the bids and validators at a given
Block. - get_
balance - Retrieves a purse’s balance at a given state root hash.
- get_
block - Retrieves a
Blockfrom the network. - get_
block_ transfers - Retrieves all
Transferitems for a givenBlock. - get_
chainspec - Retrieves the Chainspec of the network.
- get_
deploy - Retrieves a
Deployand its metadata (i.e. execution results) from the network. - get_
dictionary_ item - Retrieves a
StoredValuefrom a dictionary at a given state root hash. - get_
entity - Retrieves an
crate::rpcs::v2_0_0::get_entity::EntityOrAccountat a givenBlock. - get_
era_ info Deprecated - Retrieves era information from the network at a given switch
Block. - get_
era_ summary - Retrieves era information from the network at a given
Block. - get_
node_ status - Retrieves the status of the specified node.
- get_
peers - Retrieves the IDs and addresses of the specified node’s peers.
- get_
reward - Retrieves a
GetRewardResultat a givenEraIdentifier. - get_
state_ root_ hash - Retrieves a state root hash at a given
Block. - get_
transaction - Retrieves a
Transactionand its metadata (i.e. execution results) from the network. - get_
validator_ changes - Retrieves the status changes of the active validators on the network.
- list_
rpcs - Retrieves the interface description (the schema including examples in OpenRPC format) of the JSON-RPC server’s API.
- output_
deploy Deprecated - Outputs a
Deployto a file or stdout. - output_
transaction - Outputs a
Transactionto a file or stdout. - put_
deploy Deprecated - Puts a
Deployto the network for execution. - put_
transaction - Puts a
Transactionto the network for execution - query_
balance - Retrieves a purse’s balance from global state at a given
Blockor state root hash. - query_
balance_ details - Retrieves a purse’s balance from global state at a given
Blockor state root hash. - query_
global_ state - Retrieves a
StoredValuefrom global state at a givenBlockor state root hash. - read_
deploy_ file Deprecated - Reads a previously-saved
Deployfrom a file. - read_
transaction_ file - Reads a previously-saved
Transactionfrom a file. - send_
verification_ request - Verifies the smart contract code against the one deployed at transaction hash.
- sign_
deploy_ file Deprecated - Reads a previously-saved
Deployfrom a file, cryptographically signs it, and outputs it to a file or stdout. - sign_
transaction_ file - Reads a previously-saved
Transactionfrom a file, cryptographically signs it, and outputs it to a file or stdout. - speculative_
exec Deprecated - Puts a
Deployto a single node for speculative execution on that node only. - speculative_
exec_ txn - Puts a
Transactionto a single node for speculative execution on that node only. - verify_
contract - Verifies the smart contract code against the one deployed at given deploy or transaction hash.