Expand description
Zebra supported RPC methods.
Based on the zcashd RPC methods
as used by lightwalletd.
Some parts of the zcashd RPC documentation are outdated.
So this implementation follows the zcashd server and lightwalletd client implementations.
§Developing this module
If RPCs are added or changed, ensure the following:
-
Request types can be instantiated from dependent crates, and response types are fully-readable (up to each leaf component), meaning every field on response types can be read, and any types used in response types has an appropriate API for either directly accessing their fields, or has an appropriate API for accessing any relevant data.
This should be achieved, wherever possible, by:
- Using
derive(Getters, new)to keep new code succinct and consistent. Ensure that fields on response types that implementCopyare tagged with#[getter(copy)]field attributes to avoid unnecessary references. This should be easily noticeable in theserialization_teststest crate, where any fields implementingCopybut not tagged with#[getter(Copy)]will be returned by reference, and will require dereferencing with the dereference operator,*. If a value returned by a getter method requires dereferencing, the associated field in the response type should likely be tagged with#[getter(Copy)]. - If a field is added, use
#[new(...)]so that it’s not added to the constructor. If that is unavoidable, then it will require a major version bump.
- Using
-
A test has been added to the
serialization_teststest crate to ensure the above.
Re-exports§
pub use self::GetInfoResponse as GetInfo;pub use self::GetAddressBalanceResponse as AddressBalance;pub use self::SendRawTransactionResponse as SentTransactionHash;pub use self::GetBlockResponse as GetBlock;pub use self::GetBlockHeaderResponse as GetBlockHeader;pub use BlockHeaderObject as GetBlockHeaderObject;pub use self::GetBlockHashResponse as GetBlockHash;pub use GetBlockHeightAndHashResponse as GetBestBlockHeightAndHash;pub use self::GetRawTransactionResponse as GetRawTransaction;pub use self::Utxo as GetAddressUtxos;
Modules§
- arrayhex
- A helper module to serialize and deserialize
[u8; N]as a hex string. - opthex
- A helper module to serialize and deserialize
Option<T: ToHex>as a hex string.
Structs§
- Block
Header Object - Verbose response to a
getblockheaderRPC request. - Block
Object - A Block object returned by the
getblockRPC request. - Consensus
Branch IdHex - A hex-encoded
ConsensusBranchIdstring. - GetAddress
Balance Request - A request for
RpcServer::get_address_balance. - GetAddress
Balance Response - The transparent balance of a set of addresses.
- GetAddress
TxIds Request - Parameters of
RpcServer::get_address_tx_idsRPC method. - GetAddress
Utxos Request - Parameters of
RpcServer::get_address_utxosRPC method. - GetAddress
Utxos Response Object - Response to a
getaddressutxosRPC request, whenchainInfois true. - GetBlock
Hash Response - Response to a
getbestblockhashandgetblockhashRPC request. - GetBlock
Height AndHash Response - Response to a
getbestblockheightandhashRPC request. - GetBlock
Trees - Information about the sapling and orchard note commitment trees if any.
- GetBlockchain
Info Response - Response to a
getblockchaininfoRPC request. - GetInfo
Response - Response to a
getinfoRPC request. - Network
Upgrade Info - Information about
NetworkUpgradeactivation. - Orchard
Trees - Orchard note commitment tree information.
- RpcImpl
- RPC method implementations.
- Sapling
Trees - Sapling note commitment tree information.
- Send
RawTransaction Response - Response to a
sendrawtransactionRPC request. - TipConsensus
Branch - The
ConsensusBranchIds for the tip and the next block. - Utxo
- A UTXO returned by the
getaddressutxosRPC request.
Enums§
- AddNode
Command - Commands for the
addnodeRPC method. - GetAddress
Utxos Response - Response to a
getaddressutxosRPC request. - GetBlock
Header Response - Response to a
getblockheaderRPC request. - GetBlock
Response - Response to a
getblockRPC request. - GetBlock
Transaction - The transaction list in a
getblockcall. Can be a list of transaction IDs or the full transaction details depending on verbosity. - GetRaw
Transaction Response - Response to a
getrawtransactionRPC request. - Network
Upgrade Status - The activation status of a
NetworkUpgrade.
Traits§
- RpcServer
- Server trait implementation for the
RpcRPC API. - Validate
Addresses - A collection of validatable addresses
Functions§
- best_
chain_ tip_ height - Returns the best chain tip height of
latest_chain_tip, or an RPC error if there are no blocks in the state. - chain_
tip_ difficulty - Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
- height_
from_ signed_ int - Given a potentially negative index, find the corresponding
Height.
Type Aliases§
- Address
Strings Deprecated - A request to get the transparent balance of a set of addresses.
- Blockchain
Value Pool Balances - Type alias for the array of
GetBlockchainInfoBalanceobjects - Hash
- A block hash used by this crate that encodes as hex by default.
- Logged
Last Event - A type alias for the last event logged by the server.