@ethereumjs/common / CommonOpts
Options for instantiating a Common instance.
BaseOpts
↳ CommonOpts
• chain: string
| number
| bigint
| object
Chain name (‘mainnet’), id (1), or Chain enum, either from a chain directly supported or a custom chain passed in via customChains.
• Optional
customChains: ChainConfig
[]
Initialize (in addition to the supported chains) with the selected custom chains. Custom genesis state should be passed to the Blockchain class if used.
Usage (directly with the respective chain initialization via the chain option):
import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json'
const common = new Common({ chain: 'myCustomChain1', customChains: [ myCustomChain1 ]})
• Optional
customCrypto: CustomCrypto
This option can be used to replace the most common crypto primitives (keccak256 hashing e.g.) within the EthereumJS ecosystem libraries with alternative implementations (e.g. more performant WASM libraries).
Note: please be aware that this is adding new dependencies for your system setup to be used for sensitive/core parts of the functionality and a choice on the libraries to add should be handled with care and be made with eventual security implications considered.
BaseOpts.customCrypto
• Optional
eips: number
[]
Selected EIPs which can be activated, please use an array for instantiation
(e.g. eips: [ 1559, 3860 ]
)
BaseOpts.eips
• Optional
hardfork: string
String identifier (‘byzantium’) for hardfork or Hardfork enum.
Default: Hardfork.London
BaseOpts.hardfork