Expand description
Types and functions for the getblocktemplate
RPC.
Re-exports§
pub use constants::CAPABILITIES_FIELD;
pub use constants::DEFAULT_SOLUTION_RATE_WINDOW_SIZE;
pub use constants::MAX_ESTIMATED_DISTANCE_TO_NETWORK_CHAIN_TIP;
pub use constants::MEMPOOL_LONG_POLL_INTERVAL;
pub use constants::MUTABLE_FIELD;
pub use constants::NONCE_RANGE_FIELD;
pub use constants::NOT_SYNCED_ERROR_CODE;
pub use constants::ZCASHD_FUNDING_STREAM_ORDER;
pub use parameters::GetBlockTemplateRequestMode;
pub use parameters::JsonParameters;
pub use proposal::ProposalResponse;
pub use proposal::TimeSource;
Modules§
- constants
- Constant values used in mining rpcs methods.
- parameters
- Parameter types for the
getblocktemplate
RPC. - proposal
- getblocktemplate proposal mode implementation.
- zip317
- The ZIP-317 block production algorithm.
Structs§
- GetBlock
Template - A serialized
getblocktemplate
RPC response in template mode. - GetBlock
Template Handler - Handler for the
getblocktemplate
RPC.
Enums§
- Response
- A
getblocktemplate
RPC response.
Functions§
- calculate_
default_ root_ hashes - Returns the default block roots for the supplied coinbase and mempool transactions, and the supplied history tree.
- calculate_
miner_ fee - Returns the total miner fee for
mempool_txs
. - check_
parameters - Checks that
data
is omitted inTemplate
mode or provided inProposal
mode, - check_
synced_ to_ tip - Returns an error if Zebra is not synced to the consensus chain tip.
Returns early with
Ok(())
if Proof-of-Work is disabled on the providednetwork
. This error might be incorrect if the local clock is skewed. - fetch_
mempool_ transactions - Returns the transactions that are currently in
mempool
, or None if thelast_seen_tip_hash
from the mempool response doesn’t match the tip hash from the state. - fetch_
state_ tip_ and_ local_ time - Returns the state data for the block template.
- generate_
coinbase_ and_ roots - Generates and returns the coinbase transaction and default roots.
- standard_
coinbase_ outputs - Returns the standard funding stream and miner reward transparent output scripts
for
network
,height
andminer_fee
. - validate_
block_ proposal - Attempts to validate block proposal against all of the server’s usual acceptance rules (except proof-of-work).
Type Aliases§
- InBlock
TxDependencies Depth - An alias to indicate that a usize value represents the depth of in-block dependencies of a transaction.