I tryed to recreate a genesis block using
https://github.com/lhartikk/GenesisH0 and got errors too.
Use this method instead:
- Set your unix time in main.cpp for both testnet and main net
- Set your timestamp
- Set your nonces to 0 in main.cpp
- Compile
You'll get an error:
Assertion failed...
-Then look in your roaming folder for debug.log (in a folder named as your coin), You'll find 3 lines at the end for exemple:
b1753ec3845a48ddc4618bc595af6dc89dac328cd48f9f8db178df5dd3b302fc Block hashed using the non-existent Merkel, based on the pzTimestamp from main.cpp
0000000000000000000000000000000000000000000000000000000000000000 Genesis block, no good because all the nNonces are set to 0 in main.cpp
2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700 Valid Merkel Hash, generated using the epoch time in main.cpp
- Take the Merkle Hash you got and put it in main.cpp
- Find the line in main.cpp with
if (false && (block.GetHash() != hashGenesisBlock)) {
- Set it to
true to mine the genesis block.
- Compile (as it will mine the genesis it will take some time and maybe look frozen, don't worry).
- After, (I think you'll get "assertion failded" again) back in your debug.log. You'll find a fresh nonce (block.nNonce) and your genesis block hash (block.GetHash).
- Put them both in main.cpp, don't forget to set 0x in front of the genesis hashes (both main and testnet).
- Set the line
if (true && (block.GetHash() != hashGenesisBlock)) {
back to
false- Check if any checkpoints are set in checkpoints.cpp and if there is, change it with your genesis hash.
- Compile again
You're good