Module get_block_template

Source
Expand description

Types and functions for the getblocktemplate RPC.

Re-exports§

pub use parameters::GetBlockTemplateCapability;
pub use parameters::GetBlockTemplateParameters;
pub use parameters::GetBlockTemplateRequestMode;
pub use proposal::BlockProposalResponse;
pub use proposal::BlockTemplateTimeSource;

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§

BlockTemplateResponse
A serialized getblocktemplate RPC response in template mode.
GetBlockTemplateHandler
Handler for the getblocktemplate RPC.

Enums§

GetBlockTemplateResponse
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 in Template mode or provided in Proposal 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 provided network. 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 the last_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 and miner_fee.
validate_block_proposal
Attempts to validate block proposal against all of the server’s usual acceptance rules (except proof-of-work).