Genesis file items
Network configuration items are specified in the genesis file in the
|Milestone blocks||Milestone blocks for the network.|
|Chain ID for the network.|
|Specifies network uses Ethash and contains |
|Specifies network uses Clique and contains Clique configuration items.|
|Specifies network uses IBFT 2.0 and contains IBFT 2.0 configuration items.|
|Specifies network uses QBFT and contains QBFT configuration items.|
|Specifies block at which to change IBFT 2.0 or QBFT validators.|
|Maximum contract size in bytes. Specify in free gas networks. The default is |
|Maximum stack size. Specify to increase the maximum stack size in private networks with complex smart contracts. The default is |
|Specifies the elliptic curve to use. Default is |
|Specifies discovery configuration items. The |
Genesis block parameters
The following table describes the genesis block parameters with the same purpose across all consensus protocols.
|Address to pay mining rewards to. Can be any value in the genesis block (commonly set to |
|Block gas limit. Total gas limit for all transactions in a block.|
|Used in block computation. Can be any value in the genesis block (commonly set to |
|Creation date and time of the block. Must be before the next block so we recommend specifying |
|Defines accounts with balances or contracts.|
Supplied genesis block does not match stored chain data error occurs, use the genesis file matching the genesis block of the data directory, or use the
--data-path option to specify a different data directory.
In public networks, the milestone blocks specify the blocks at which the network changed protocol. See a full list of Ethereum protocol releases and their corresponding milestone blocks.
Ensure you include a milestone far enough in advance in the genesis file. Not doing so can lead to unexpected and inconsistent behavior without specific errors.
In private networks, the milestone block defines the protocol version for the network.
In private networks, we recommend specifying the latest milestone block. It's implied this includes the preceding milestones. This ensures you use the most up-to-date protocol and have access to the most recent opcodes.
fixeddifficulty to specify a fixed difficulty in private networks using Ethash. This will keep the network's difficulty constant and override the
difficulty parameter from the genesis file.
fixeddifficulty is not recommended for use with Ethash outside of test environments. For production networks using Ethash, we recommend setting a low
difficulty value in the genesis file instead. Ethash will adjust the difficulty of the network based on hashrate to produce blocks at the targeted frequency.
Discovery configuration items
discovery configuration items to specify the
discovery-dns-url in the genesis file, in place of using CLI options or listing them in the configuration file. If either CLI option is used, it takes precedence over the genesis file. Anything listed in the configuration file also takes precedence.