0

Following this guide, I'm trying to learn how to mine a genesis block, not to launch another altcoin or anything, blockchain databases are going to be important and I want to be ahead of the curve.

I'm using this script and working with the litecoin source. I have only changed the following:

find LoadBlockIndex() function, inside, change:
    - paraphrase (pszTimestamp) to any recent news phase.
    - get the latest unix time (do a google), and put in block.nTime.
    - set any nNonce (doesn't really matter)
you can change the time/nonce for testnet too, if you want to use it.

Those variables are now found in chainparams.cpp and I didn't change the testnet time/nonce.

After compiling when I try to run litecoind I get the following error:

litecoind: chainparams.cpp:220: CTestNetParams::CTestNetParams(): Assertion `hashGenesisBlock == uint256("0xf5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f")' failed.
Aborted

If anyone can help or point me in the direction of some modern documentation I'd me most grateful :)

5
  • If you change the genesis block you have to change the hash check assertion, because the hash will have changed.
    – morsecoder
    Commented Mar 5, 2016 at 14:58
  • Related: bitcoin.stackexchange.com/questions/34107/…. This question seems to have better answers, so maybe the linked question should be marked as a duplicate of this.
    – morsecoder
    Commented Mar 5, 2016 at 14:58
  • Thanks @StephenM347 but how do I calculate what the 'hash check assertion' should be?
    – derrend
    Commented Mar 5, 2016 at 20:30
  • Also there are no answers in the link you provided.
    – derrend
    Commented Mar 5, 2016 at 20:36
  • After this, you maybe suffer ReadBlockFromDisk: Errors in block header at CBlockDiskPos(, have you?
    – creator
    Commented Mar 2, 2018 at 14:06

2 Answers 2

2

How to make an altcoin on Bear's Den

0

You have to add smth like this genesis.nNonce = 353314; hashGenesisBlock = genesis.GetHash();

LogPrintf("Display genesis hash so we can input it below %s\n", hashGenesisBlock.ToString().c_str());

assert(hashGenesisBlock == uint256("0xe133d1d3f584f1c3f561e7d0606fa87dabb869325a979c2a82e2f3943c0e3370")); vFixedSeeds.clear();

then after ./coind in debug.log you can get genesis hash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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