Skip to main content

parseGethGenesis

Callable

  • parseGethGenesis(json: any, name?: string, mergeForkIdPostMerge?: boolean): { bootstrapNodes: never[]; chainId: number; consensus: { algorithm: string; clique: { epoch: any; period: any }; ethash?: undefined; type: string } | { algorithm: string; clique?: undefined; ethash: {}; type: string }; genesis: { baseFeePerGas: string; coinbase: string; difficulty: number; extraData: string; gasLimit: number; mixHash: string; nonce: string; timestamp: string }; hardfork: undefined | string; hardforks: ConfigHardfork[]; name: string; networkId: number }

  • Parses a genesis.json exported from Geth into parameters for Common instance


    Parameters

    • json: any

      representing the Geth genesis file

    • optionalname: string

      optional chain name

    • optionalmergeForkIdPostMerge: boolean

    Returns { bootstrapNodes: never[]; chainId: number; consensus: { algorithm: string; clique: { epoch: any; period: any }; ethash?: undefined; type: string } | { algorithm: string; clique?: undefined; ethash: {}; type: string }; genesis: { baseFeePerGas: string; coinbase: string; difficulty: number; extraData: string; gasLimit: number; mixHash: string; nonce: string; timestamp: string }; hardfork: undefined | string; hardforks: ConfigHardfork[]; name: string; networkId: number }

    parsed params

    • bootstrapNodes: never[]
    • chainId: number
    • consensus: { algorithm: string; clique: { epoch: any; period: any }; ethash?: undefined; type: string } | { algorithm: string; clique?: undefined; ethash: {}; type: string }
    • genesis: { baseFeePerGas: string; coinbase: string; difficulty: number; extraData: string; gasLimit: number; mixHash: string; nonce: string; timestamp: string }
      • baseFeePerGas: string
      • coinbase: string
      • difficulty: number
      • extraData: string
      • gasLimit: number
      • mixHash: string
      • nonce: string
      • timestamp: string
    • hardfork: undefined | string
    • hardforks: ConfigHardfork[]
    • name: string
    • networkId: number