Struct ckb_chain_spec::consensus::Consensus[][src]

pub struct Consensus {
    pub id: String,
    pub genesis_block: BlockView,
    pub genesis_hash: Byte32,
    pub dao_type_hash: Option<Byte32>,
    pub secp256k1_blake160_sighash_all_type_hash: Option<Byte32>,
    pub secp256k1_blake160_multisig_all_type_hash: Option<Byte32>,
    pub initial_primary_epoch_reward: Capacity,
    pub secondary_epoch_reward: Capacity,
    pub max_uncles_num: usize,
    pub orphan_rate_target: RationalU256,
    pub epoch_duration_target: u64,
    pub tx_proposal_window: ProposalWindow,
    pub proposer_reward_ratio: Ratio,
    pub pow: Pow,
    pub cellbase_maturity: EpochNumberWithFraction,
    pub median_time_block_count: usize,
    pub max_block_cycles: Cycle,
    pub max_block_bytes: u64,
    pub block_version: Version,
    pub tx_version: Version,
    pub type_id_code_hash: H256,
    pub max_block_proposals_limit: u64,
    pub genesis_epoch_ext: EpochExt,
    pub satoshi_pubkey_hash: H160,
    pub satoshi_cell_occupied_ratio: Ratio,
    pub primary_epoch_reward_halving_interval: EpochNumber,
    pub permanent_difficulty_in_dummy: bool,
}

Struct Consensus defines various parameters that influence chain consensus

Fields

id: String

Names the network.

genesis_block: BlockView

The genesis block

genesis_hash: Byte32

The genesis block hash

dao_type_hash: Option<Byte32>

The dao type hash

nervos-dao

secp256k1_blake160_sighash_all_type_hash: Option<Byte32>

The secp256k1_blake160_sighash_all_type_hash

SECP256K1/blake160

secp256k1_blake160_multisig_all_type_hash: Option<Byte32>

The secp256k1_blake160_multisig_all_type_hash

SECP256K1/multisig

initial_primary_epoch_reward: Capacity

The initial primary_epoch_reward

token-issuance

secondary_epoch_reward: Capacity

The secondary primary_epoch_reward

token-issuance

max_uncles_num: usize

The maximum amount of uncles allowed for a block

orphan_rate_target: RationalU256

The expected orphan_rate

epoch_duration_target: u64

The expected epoch_duration

tx_proposal_window: ProposalWindow

The two-step-transaction-confirmation proposal window

proposer_reward_ratio: Ratio

The two-step-transaction-confirmation proposer reward ratio

pow: Pow

The pow parameters

cellbase_maturity: EpochNumberWithFraction

The Cellbase maturity For each input, if the referenced output transaction is cellbase, it must have at least cellbase_maturity confirmations; else reject this transaction.

median_time_block_count: usize

This parameter indicates the count of past blocks used in the median time calculation

max_block_cycles: Cycle

Maximum cycles that all the scripts in all the commit transactions can take

max_block_bytes: u64

Maximum number of bytes to use for the entire block

block_version: Version

The block version number supported

tx_version: Version

The tx version number supported

type_id_code_hash: H256

The “TYPE_ID” in hex

max_block_proposals_limit: u64

The Limit to the number of proposals per block

genesis_epoch_ext: EpochExt

The genesis epoch information

satoshi_pubkey_hash: H160

Satoshi’s pubkey hash in Bitcoin genesis.

satoshi_cell_occupied_ratio: Ratio

Ratio of satoshi cell occupied of capacity, only affects genesis cellbase’s satoshi lock cells.

primary_epoch_reward_halving_interval: EpochNumber

Primary reward is cut in half every halving_interval epoch which will occur approximately every 4 years.

permanent_difficulty_in_dummy: bool

Keep difficulty be permanent if the pow is dummy

Implementations

impl Consensus[src]

pub fn genesis_block(&self) -> &BlockView[src]

The genesis block

pub fn proposer_reward_ratio(&self) -> Ratio[src]

The two-step-transaction-confirmation proposer reward ratio

pub fn finalization_delay_length(&self) -> BlockNumber[src]

The two-step-transaction-confirmation block reward delay length

pub fn finalize_target(&self, block_number: BlockNumber) -> Option<BlockNumber>[src]

Get block reward finalize number from specified block number

pub fn genesis_hash(&self) -> Byte32[src]

The genesis block hash

pub fn dao_type_hash(&self) -> Option<Byte32>[src]

The dao type hash

nervos-dao

pub fn secp256k1_blake160_sighash_all_type_hash(&self) -> Option<Byte32>[src]

The secp256k1_blake160_sighash_all_type_hash

SECP256K1/blake160

pub fn secp256k1_blake160_multisig_all_type_hash(&self) -> Option<Byte32>[src]

The secp256k1_blake160_multisig_all_type_hash

SECP256K1/multisig

pub fn max_uncles_num(&self) -> usize[src]

The maximum amount of uncles allowed for a block

pub fn min_difficulty(&self) -> U256[src]

The minimum difficulty (genesis_block difficulty)

pub fn initial_primary_epoch_reward(&self) -> Capacity[src]

The minimum difficulty (genesis_block difficulty)

pub fn primary_epoch_reward(&self, epoch_number: u64) -> Capacity[src]

The initial primary_epoch_reward

token-issuance

pub fn primary_epoch_reward_halving_interval(&self) -> EpochNumber[src]

Primary reward is cut in half every halving_interval epoch which will occur approximately every 4 years.

pub fn epoch_duration_target(&self) -> u64[src]

The expected epoch_duration

pub fn genesis_epoch_ext(&self) -> &EpochExt[src]

The genesis epoch information

pub fn max_epoch_length(&self) -> BlockNumber[src]

The maximum epoch length

pub fn min_epoch_length(&self) -> BlockNumber[src]

The minimum epoch length

pub fn secondary_epoch_reward(&self) -> Capacity[src]

The secondary primary_epoch_reward

token-issuance

pub fn orphan_rate_target(&self) -> &RationalU256[src]

The expected orphan_rate

pub fn pow_engine(&self) -> Arc<dyn PowEngine>[src]

The pow_engine

pub fn permanent_difficulty(&self) -> bool[src]

The permanent_difficulty mode

pub fn cellbase_maturity(&self) -> EpochNumberWithFraction[src]

The cellbase_maturity

pub fn median_time_block_count(&self) -> usize[src]

This parameter indicates the count of past blocks used in the median time calculation

pub fn max_block_cycles(&self) -> Cycle[src]

Maximum cycles that all the scripts in all the commit transactions can take

pub fn max_block_bytes(&self) -> u64[src]

Maximum number of bytes to use for the entire block

pub fn max_block_proposals_limit(&self) -> u64[src]

The Limit to the number of proposals per block

pub fn block_version(&self) -> Version[src]

The current block version

pub fn tx_version(&self) -> Version[src]

The current transaction version

pub fn type_id_code_hash(&self) -> &H256[src]

The “TYPE_ID” in hex

pub fn tx_proposal_window(&self) -> ProposalWindow[src]

The two-step-transaction-confirmation proposal window

pub fn next_epoch_ext<A, B>(
    &self,
    last_epoch: &EpochExt,
    header: &HeaderView,
    get_block_header: A,
    total_uncles_count: B
) -> Option<EpochExt> where
    A: Fn(&Byte32) -> Option<HeaderView>,
    B: Fn(&Byte32) -> Option<u64>, 
[src]

pub fn identify_name(&self) -> String[src]

The network identify name, used for network identify protocol

pub fn get_secp_type_script_hash(&self) -> Byte32[src]

The secp256k1_blake160_sighash_all code hash

Trait Implementations

impl Clone for Consensus[src]

impl Debug for Consensus[src]

impl Default for Consensus[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,