I am attempting to update the config.go file parameter

MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") 

How can I get this value from my own private ethereum network please?

1 Answer 1


A couple of ideas.

You should be able to get the hash of your Genesis block by running eth.getBlock(0) (under the hash: entry in the output). This would be the easiest way.

Alternatively, if you run the appropriate test code (i.e. basically the code in genesis_test.go), the tests will fail saying there's a mismatch between the hard-coded value (that you're trying to change) and the actual hash of your genesis block. Simply use the hash value it spits out in the error message. (Or convert it back to hex.)

There error message is here:

if block.Hash() != params.MainnetGenesisHash {
    t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash)

See the Testing section of the Developer's Guide for details on how to run the tests. (There's also the Testing page on the wiki, but I'm unsure how up to date it is.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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