ethereumjs-monorepo

@ethereumjs/blockchain


@ethereumjs/blockchain / GenesisOptions

Interface: GenesisOptions

Defined in: types.ts:94

Extended by

Properties

genesisBlock?

optional genesisBlock: Block

Defined in: types.ts:102

The blockchain only initializes successfully if it has a genesis block. If there is no block available in the DB and a genesisBlock is provided, then the provided genesisBlock will be used as genesis. If no block is present in the DB and no block is provided, then the genesis block as provided from the common will be used.


genesisState?

optional genesisState: GenesisState

Defined in: types.ts:128

If you are using a custom chain Common, pass the genesis state.

Pattern 1 (with genesis state see GenesisState for format):

{
  '0x0...01': '0x100', // For EoA
}

Pattern 2 (with complex genesis state, containing contract accounts and storage). Note that in AccountState there are two accepted types. This allows to easily insert accounts in the genesis state:

A complex genesis state with Contract and EoA states would have the following format:

{
  '0x0...01': '0x100', // For EoA
  '0x0...02': ['0x1', '0xRUNTIME_BYTECODE', [[storageKey1, storageValue1], [storageKey2, storageValue2]]] // For contracts
}

genesisStateRoot?

optional genesisStateRoot: Uint8Array<ArrayBufferLike>

Defined in: types.ts:133

State root of the genesis state