Module casper_client::cli
source · Expand description
An API suitable for use by a CLI binary.
It provides functions and types largely based around strings and integers, as would be expected to be input by a CLI user. The functions then parse these inputs into the expected Rust types and pass them through to the equivalent API functions defined in the root of the library.
Common Parameters
Many of the functions have similar parameters. Descriptions for these common ones follow:
maybe_rpc_id
- The JSON-RPC identifier, applied to the request and returned in the response. If it can be parsed as ani64
it will be used as a JSON integer. If empty, a randomi64
will be assigned. Otherwise the provided string will be used verbatim.node_address
- The hostname or IP and port of the server, e.g.http://127.0.0.1:7777
.verbosity_level
- When1
, the JSON-RPC request will be printed tostdout
with long string fields (e.g. hex-formatted raw Wasm bytes) shortened to a string indicating the char count of the field. Whenverbosity_level
is greater than1
, the request will be printed tostdout
with no abbreviation of long fields. Whenverbosity_level
is0
, the request will not be printed tostdout
.maybe_block_id
- Must be a hex-encoded, 32-byte hash digest or au64
representing theBlock
height or empty. If empty, the latestBlock
known on the server will be used.
Modules
- Deploy module.
- Functions for use in help commands.
- Functions for use in help commands.
Structs
- Container for
Deploy
construction options. - Error associated with parsing a JSON arg into a
NamedArg
. - Container for payment-related arguments used while constructing a
Deploy
. - Container for session-related arguments used while constructing a
Deploy
.
Enums
- Error that can be returned by the
cli
API. - Various ways of uniquely identifying a dictionary item.
- Details of an error associated with parsing a JSON arg into a
NamedArg
.
Functions
- Retrieves the bids and validators at a given
Block
. - Retrieves a purse’s balance at a given state root hash.
- Retrieves a
Block
from the network. - Retrieves the Chainspec of the network.
- Retrieves a
Deploy
from the network. - Retrieves a
StoredValue
from a dictionary at a given state root hash. - get_era_infoDeprecatedRetrieves era information from the network at a given switch
Block
. - Retrieves era information from the network at a given
Block
. - Retrieves the status of the specified node.
- Retrieves the IDs and addresses of the specified node’s peers.
- Retrieves a state root hash at a given
Block
. - Retrieves the status changes of the active validators on the network.
- JSON-encode and pretty-print the given value to stdout at the given verbosity level.
- Retrieves the interface description (the schema including examples in OpenRPC format) of the JSON-RPC server’s API.
- Creates a
Deploy
and outputs it to a file or stdout. - Creates a transfer
Deploy
and outputs it to a file or stdout. - Creates a
Deploy
and sends it to the network for execution. - Retrieves a purse’s balance from global state.
- Retrieves a
StoredValue
from global state. - Reads a previously-saved
Deploy
from a file and sends it to the network for execution. - Reads a previously-saved
Deploy
from a file, cryptographically signs it, and outputs it to a file or stdout. - Creates a
Deploy
and sends it to the specified node for speculative execution. - Reads a previously-saved
Deploy
from a file and sends it to the specified node for speculative execution. For details of the parameters, see the module docs. - Creates a
Deploy
to transfer funds between purses, and sends it to the specified node for speculative execution. - Transfers funds between purses.