Bitcoin Forum
June 14, 2024, 08:27:30 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Genesis Block - Help my soul  (Read 113 times)
robert.duhn (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
December 30, 2017, 03:41:29 AM
 #1

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
Code:
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:
Code:
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)
Code:
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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!