pub struct Genesis {Show 13 fields
pub config: ChainConfig,
pub nonce: u64,
pub timestamp: u64,
pub extra_data: Bytes,
pub gas_limit: u128,
pub difficulty: Uint<256, 4>,
pub mix_hash: FixedBytes<32>,
pub coinbase: Address,
pub alloc: BTreeMap<Address, GenesisAccount>,
pub base_fee_per_gas: Option<u128>,
pub excess_blob_gas: Option<u128>,
pub blob_gas_used: Option<u128>,
pub number: Option<u64>,
}
Expand description
Re-export the Genesis type from alloy_genesis. The genesis block specification.
Fields§
§config: ChainConfig
The fork configuration for this network.
nonce: u64
The genesis header nonce.
timestamp: u64
The genesis header timestamp.
extra_data: Bytes
The genesis header extra data.
gas_limit: u128
The genesis header gas limit.
difficulty: Uint<256, 4>
The genesis header difficulty.
mix_hash: FixedBytes<32>
The genesis header mix hash.
coinbase: Address
The genesis header coinbase address.
alloc: BTreeMap<Address, GenesisAccount>
The initial state of accounts in the genesis block.
base_fee_per_gas: Option<u128>
The genesis header base fee
excess_blob_gas: Option<u128>
The genesis header excess blob gas
blob_gas_used: Option<u128>
The genesis header blob gas used
number: Option<u64>
The genesis block number
Implementations§
Source§impl Genesis
impl Genesis
Sourcepub fn clique_genesis(chain_id: u64, signer_addr: Address) -> Genesis
pub fn clique_genesis(chain_id: u64, signer_addr: Address) -> Genesis
Creates a chain config for Clique using the given chain id and funds the given address with max coins.
Enables all hard forks up to London at genesis.
Sourcepub const fn with_nonce(self, nonce: u64) -> Genesis
pub const fn with_nonce(self, nonce: u64) -> Genesis
Set the nonce.
Sourcepub const fn with_timestamp(self, timestamp: u64) -> Genesis
pub const fn with_timestamp(self, timestamp: u64) -> Genesis
Set the timestamp.
Sourcepub fn with_extra_data(self, extra_data: Bytes) -> Genesis
pub fn with_extra_data(self, extra_data: Bytes) -> Genesis
Set the extra data.
Sourcepub const fn with_gas_limit(self, gas_limit: u128) -> Genesis
pub const fn with_gas_limit(self, gas_limit: u128) -> Genesis
Set the gas limit.
Sourcepub const fn with_difficulty(self, difficulty: Uint<256, 4>) -> Genesis
pub const fn with_difficulty(self, difficulty: Uint<256, 4>) -> Genesis
Set the difficulty.
Sourcepub const fn with_mix_hash(self, mix_hash: FixedBytes<32>) -> Genesis
pub const fn with_mix_hash(self, mix_hash: FixedBytes<32>) -> Genesis
Set the mix hash of the header.
Sourcepub const fn with_coinbase(self, address: Address) -> Genesis
pub const fn with_coinbase(self, address: Address) -> Genesis
Set the coinbase address.
Sourcepub const fn with_base_fee(self, base_fee: Option<u128>) -> Genesis
pub const fn with_base_fee(self, base_fee: Option<u128>) -> Genesis
Set the base fee.
Sourcepub const fn with_excess_blob_gas(
self,
excess_blob_gas: Option<u128>,
) -> Genesis
pub const fn with_excess_blob_gas( self, excess_blob_gas: Option<u128>, ) -> Genesis
Set the excess blob gas.
Sourcepub const fn with_blob_gas_used(self, blob_gas_used: Option<u128>) -> Genesis
pub const fn with_blob_gas_used(self, blob_gas_used: Option<u128>) -> Genesis
Set the blob gas used.
Sourcepub fn extend_accounts(
self,
accounts: impl IntoIterator<Item = (Address, GenesisAccount)>,
) -> Genesis
pub fn extend_accounts( self, accounts: impl IntoIterator<Item = (Address, GenesisAccount)>, ) -> Genesis
Add accounts to the genesis block. If the address is already present, the account is updated.