In a custom fork of Ethereum my team is developing, we need to read a new config parameter from genesis block. At https://github.com/ethereum/go-ethereum/blob/master/cmd/evm/runner.go#L100 the code line:

gen := readGenesis(ctx.GlobalString(GenesisFlag.Name))

is supposed to read a config parameter from genesis block, right?

But what is ctx?, how to specify the flag name to GlobalString?

What goLang code would we need to read a given parameter, such as MyParameter from genesis block?

Is there any documentation about the go-ethereum code? Who did develop this code? Can I talk to him/her? Thx!

1 Answer 1


By looking at it, go-ethereum is using the urfave/cli package for reading and parsing command line arguments. You can specify a new cli argument here.

readGenesis is simply unmarshalling the json from the genesis path into the Genesis type, which you can extend by adding your new properties there.

  • Thx! but I am not looking for a way to read command line arguments, but genesis parameters, not really from genesis.json but directly from genesis block 0 Apr 8, 2019 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.