<p><code>chainparams.cpp</code> contains a line of code that checks whether the chain’s genesis block is equal to a specified hash. Since you created a new genesis block, you will have to update the value to your own hash.</p>

<p>You can see an example for the line here: </p>

<pre><code> hashGenesisBlock = genesis.GetHash();
 assert(hashGenesisBlock == uint256("9915158279673d101912be80f25c20627f1dd8bf5231e7c46bfec5ed19737f44"));
</code></pre>

<p>Which I took from <a href="https://github.com/miguelfreitas/twister-core/blob/master/src/chainparams.cpp#L216" rel="nofollow">miguelfreitas/twister-core/…/chainparams.cpp</a></p>

<p>To figure out what to put there, you can print <code>genesis.GetHash()</code> and replace the old hash in the assertion.</p>

<p>To print it the hash of the genesis block, you can use</p>

<pre><code>printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());
</code></pre>

<p>just above the line with the assertion, which will write to the <code>~/.bitcoin/debug.log</code>.</p>

CC BY-SA 3.0
2016-01-04T12:50:50.547Z
Hi , I ave also printed the genesis.hashMerkleRoot using above example ,Please tell me where I put these hash to create genesis block?
amit kumar
CC BY-SA 3.0
2016-01-05T07:23:46.437Z
Thanks, I got the solution https://bitcointalk.org/index.php?topic=391983.msg4223449#msg4223449
amit kumar
CC BY-SA 3.0
2018-02-13T08:13:51.853Z
at newest source bitcoin 0.15.1, debug.log file does not be generated? Why?
creator
CC BY-SA 3.0
2018-02-13T16:41:34.087Z
@leegod: If you have a new question, please start another topic
Murch
CC BY-SA 3.0
2018-02-23T01:39:03.600Z
Hi. So even if after change hash value to match, but still another occured, 

ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)

I posted this forum, replier says 

"Your genesis block is wrong. You actually have to mine the block, not just change the parameters."

but, how to? I searched a lot but most code mine the block is outdated, and not work at currently. Do you know this solution? Thanks.
creator
CC BY-SA 3.0
2016-01-04T10:14:51.917Z
2016-01-04T12:09:08.707Z
2016-01-04T12:09:08.707Z
Murch
<p>I am trying to create a genesis block in twister-core using Ubuntu and IDE Qt Creator. I have compiled the twister-core successfully, I have changed the these parameters for creating the genesis block <code>pszTimestamp</code>, <code>genesis.nTime</code>   and  <code>genesis.nNonce</code>. Then I re-compiled it successfully. When I am executing <code>twisterd</code> in the terminal using this command </p>

<pre><code>./twisterd -rpcuser=user -rpcpassword=pwd -rpcallowip=127.0.0.1
</code></pre>

<p>this error occured:</p>

<blockquote>
  <p>Terminal Error :<br>
  Assertion `hashGenesisBlock == uint256("b24b7a9c568b4ae288c0be34699c4c79fc22848e7c346afd5f63901e41ed8640")' failed.
  Aborted (core dumped)</p>
</blockquote>

<p>When I run it On Qt-Creator same error occur Error:</p>

<blockquote>
  <p>twisterd: ../twister/src/chainparams.cpp:216: CMainParams::CMainParams(): Assertion `hashGenesisBlock == uint256("b24b7a9c568b4ae288c0be34699c4c79fc22848e7c346afd5f63901e41ed8640")' failed.<br>
  The program has unexpectedly finished.<br>
  ../twister-qt-Output/twisterd exited with code 0</p>
</blockquote>

<p>Please help me to resolve this problem.</p>

CC BY-SA 3.0
2016-01-04T10:21:40.257Z
possible duplicate of [How can I create a new Genesis Block?](http://bitcoin.stackexchange.com/q/21303/5406)
Murch
<bitcoin-core-development><genesis-block><altcoin-development>
Problem In Creating Genesis Block Twister-Core using Ubuntu and (Qt Creator IDE)
amit kumar
# Problem In Creating Genesis Block Twister-Core using Ubuntu and (Qt Creator IDE)

(Asked by: username_0 on 2016-01-04)

I am trying to create a genesis block in twister-core using Ubuntu and IDE Qt Creator. I have compiled the twister-core successfully, I have changed the these parameters for creating the genesis block pszTimestamp, genesis.nTime   and  genesis.nNonce. Then I re-compiled it successfully. When I am executing twisterd in the terminal using this command 
./twisterd -rpcuser=user -rpcpassword=pwd -rpcallowip=127.0.0.1

this error occured:

Terminal Error :
  Assertion `hashGenesisBlock == uint256("b24b7a9c568b4ae288c0be34699c4c79fc22848e7c346afd5f63901e41ed8640")' failed.
  Aborted (core dumped)

When I run it On Qt-Creator same error occur Error:

twisterd: ../twister/src/chainparams.cpp:216: CMainParams::CMainParams(): Assertion `hashGenesisBlock == uint256("b24b7a9c568b4ae288c0be34699c4c79fc22848e7c346afd5f63901e41ed8640")' failed.
  The program has unexpectedly finished.
  ../twister-qt-Output/twisterd exited with code 0

Please help me to resolve this problem.

**Tags:** bitcoin-core-development, genesis-block, altcoin-development

> **Comments:**
> **username_1**: possible duplicate of [How can I create a new Genesis Block?](http://bitcoin.stackexchange.com/q/21303/5406)  

---

## 1 answers

### Answer by username_1 on 2016-01-04. Score: 2 | Accepted answer

chainparams.cpp contains a line of code that checks whether the chain’s genesis block is equal to a specified hash. Since you created a new genesis block, you will have to update the value to your own hash.
You can see an example for the line here: 
 hashGenesisBlock = genesis.GetHash();
 assert(hashGenesisBlock == uint256("9915158279673d101912be80f25c20627f1dd8bf5231e7c46bfec5ed19737f44"));

Which I took from miguelfreitas/twister-core/…/chainparams.cpp
To figure out what to put there, you can print genesis.GetHash() and replace the old hash in the assertion.
To print it the hash of the genesis block, you can use
printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());

just above the line with the assertion, which will write to the ~/.bitcoin/debug.log.

> **Comments:**
> **username_0**: Hi , I ave also printed the genesis.hashMerkleRoot using above example ,Please tell me where I put these hash to create genesis block?  
> **username_0**: Thanks, I got the solution https://bitcointalk.org/index.php?topic=391983.msg4223449#msg4223449  
> **username_2**: at newest source bitcoin 0.15.1, debug.log file does not be generated? Why?  
> **username_1**: @leegod: If you have a new question, please start another topic  
> **username_2**: Hi. So even if after change hash value to match, but still another occured,   ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)  I posted this forum, replier says   "Your genesis block is wrong. You actually have to mine the block, not just change the parameters."  but, how to? I searched a lot but most code mine the block is outdated, and not work at currently. Do you know this solution? Thanks.  

---

