What I did so far:
Change pszTimestamp to a sentence from newspaper
change block.nTime to current time
compile
run compiled source with -testnet -noirc
now u see some lines and a crash
b115383690ee67ebeef9a7e754342638cd7bbf488561998e6d1bc1ed367484f6 // Block derived from pszTimestamp
b8fa883689f099d3942ff73439d9f55d60a5e257b0d69a8f0f6ab4572ecff415 // Genesisblock (invalid cuz its already coded wrong)
bd58bf217abb76059de07dc519f6c3dcdf5b1a7bb9219a66d24205e08f3716f9 // MerkleRoot (Valid because its newly calculated
corresponding to code:
//// debug print
printf("%s\n", block.GetHash().ToString().c_str());
printf("%s\n", hashGenesisBlock.ToString().c_str());
printf("%s\n", block.hashMerkleRoot.ToString().c_str());
assert(block.hashMerkleRoot == uint256("0xbd58bf217abb76059de07dc519f6c3dcdf5b1a7bb9219a66d24205e08f3716f9"));
update main.cpp with the mentioned merkleroot (it crashed because of the last assert) and run again
you should have already changed the false to true in
// If genesis block hash does not match, then generate new genesis hash.
if (true && block.GetHash() != hashGenesisBlock)
so it will find a genesis block for your string
after a long time you get:
nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000)
block.nTime = 1367704866
block.nNonce = 3939341
block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33
CBlock(hash=fafdbfc957ea6867a074, PoW=000000b1398554a520b5, ver=1, hashPrevBlock=00000000000000000000, hashMerkleRoot=bd58bf217a, nTime=1367704866, nBits=1e0ffff0, nNonce=3939341, vtx=1)
CTransaction(hash=bd58bf217a, ver=1, vin.size=1, vout.size=1, nLockTime=0)
CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d01043741442e6e6c20342f352042657672696a64696e6773646167207a6f6e6e69672c20646161726e61206f6f6b207a6f6d657273207761726d)
CTxOut(error)
vMerkleTree: bd58bf217a
xx: main.cpp:2070: bool LoadBlockIndex(bool): Assertion `block.GetHash() == hashGenesisBlock' failed.
Aborted (core dumped)
Now you have the valid Genesisblock and nNonce:
block.nNonce = 3939341
block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33
Update your code with these values and your ready to go!
i have to reactivate this topic. i am playing with coin-cloning an now i am stuck at the MerkleRoot-part.
The app crashes and in terminal i got this:
Assertion failed: (block.hashMerkleRoot == uint256("0x")), function LoadBlockIndex, file main.cpp, line 2031.
Abort trap: 6
and according to this how-to (
https://gist.github.com/mhsjlw/8130158de01071aa8c87) i should find the hash in a log file. but in the only corresponding log file i found i only have this.
c6e32eac75316aa6be562726b219fac84560439fea1c819550fb95abbeb23582
5813d4cfab0eeda94a15d11c5e7d6895e667fbbe67c59ef9a1b3bc232c9a0b7f
c12f442c067f5c64e58e294d423c36b42201801a55ed551fa0d4da57b1810651
the how-to says i should have something like this:
Thanks to tyrion's amazingly helpful post, we can decipher this debug out put as so:
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
or is one off the three lines above the hash i need?
thank you.
EDIT: i got it, reformatting the text from the how-to solves the problem.... the third line is the hash i need.