For study and fun i'm trying to create my altcoin [with new blockchain].
I've decided to fork ZCOIN.
Following
https://bitcointalk.org/index.php?topic=225690.0 and other example:
I have put the new nTime and new *pszTimestamp
I have printed out the new genesisBlockHash in main network, testnet and regtest, and change the assertion with new hashes
const std::string s = genesis.GetHash().ToString();
consensus.hashGenesisBlock = genesis.GetHash();
std::cout << "zcoin new hashMerkleRoot hash: " << genesis.hashMerkleRoot.ToString() << std::endl;
std::cout << "zcoin new genesisBlock hash: " << consensus.hashGenesisBlock.ToString() << std::endl;
Removed all the checkpoints and seeds from old network but when the deamon start, I always get this error:
ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
...
Failed to connect best block
Going a bit deeper I see that the statement always fail (in block.cpp)
if (!CheckProofOfWork(block.GetPoWHash(nHeight), block.nBits, consensusParams))
I really cannot find how set the block.nBits value.
After hours spending I'm guessing how others altcoin generate the genesis block?
Is something about difficulty of the hashes? There's a way in 2017 to generate the genesisBlock in the codebase?
I also tried external tools for generate genesisblock hash but i'm guessing why other codebases (litecoin, bitcoin or other created few days ago) doesn't have such complicated hash for the genesisblock.
Any ideas, thank you all in advance.