Crate casper_client

Source
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 - When Low, nothing is printed to stdout. For Medium, the request and response are printed to stdout with long string fields (e.g. hex-formatted raw Wasm bytes) shortened to a string indicating the char count of the field. High verbosity is the same as Medium except without abbreviation of long fields.
  • maybe_block_identifier: Option<BlockIdentifier> - The identifier of the Block to use, either block height or block hash. If None, the latest Block known 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§

SuccessResponse
A successful response to a JSON-RPC request.

Enums§

Error
Errors that may be returned by casper_client functions.
JsonRpcId
An identifier for a JSON-RPC, provided by the client and returned in the response.
OutputKind
An output abstraction for associating a Write object with some metadata.
ValidateResponseError
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 Account at a given Block.
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 Block from the network.
get_block_transfers
Retrieves all Transfer items for a given Block.
get_chainspec
Retrieves the Chainspec of the network.
get_deploy
Retrieves a Deploy and its metadata (i.e. execution results) from the network.
get_dictionary_item
Retrieves a StoredValue from a dictionary at a given state root hash.
get_entity
Retrieves an crate::rpcs::v2_0_0::get_entity::EntityOrAccount at a given Block.
get_era_infoDeprecated
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 GetRewardResult at a given EraIdentifier.
get_state_root_hash
Retrieves a state root hash at a given Block.
get_transaction
Retrieves a Transaction and 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_deployDeprecated
Outputs a Deploy to a file or stdout.
output_transaction
Outputs a Transaction to a file or stdout.
put_deployDeprecated
Puts a Deploy to the network for execution.
put_transaction
Puts a Transaction to the network for execution
query_balance
Retrieves a purse’s balance from global state at a given Block or state root hash.
query_balance_details
Retrieves a purse’s balance from global state at a given Block or state root hash.
query_global_state
Retrieves a StoredValue from global state at a given Block or state root hash.
read_deploy_fileDeprecated
Reads a previously-saved Deploy from a file.
read_transaction_file
Reads a previously-saved Transaction from a file.
send_verification_request
Verifies the smart contract code against the one deployed at transaction hash.
sign_deploy_fileDeprecated
Reads a previously-saved Deploy from a file, cryptographically signs it, and outputs it to a file or stdout.
sign_transaction_file
Reads a previously-saved Transaction from a file, cryptographically signs it, and outputs it to a file or stdout.
speculative_execDeprecated
Puts a Deploy to a single node for speculative execution on that node only.
speculative_exec_txn
Puts a Transaction to 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.