<pre><code>genesis.GetHash("");
</code></pre>

<p>This is incorrect. <code>GetHash</code> does not take a parameter, as said in the compiler error. This should just be <code>genesis.GetHash();</code>.</p>

<blockquote>
  <p>I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.</p>
</blockquote>

<p>The debug.log file is only modified when  you run the program, and because it isn't even compiling, when you run it, you are not running it with any of your changes.</p>

CC BY-SA 3.0
2018-01-11T17:48:47.073Z
How much time it takes to create hash of genesis block? I am using this script https://github.com/lhartikk/GenesisH0  but stuck for 8 hrs.
`algorithm: SHA256
merkle hash: 7d8d77f82fff1c303f864fcd9e48f2e20c50ff91c7144fc0bb8092205662dc33
pszTimestamp: Democracy Now 03/Jan/2018 Trump Administration Will Withhold Pakistan Military Aid
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
time: 1515428732
bits: 0x1d00ffff
Searching for genesis hash..
149739.0 hash/s, estimate: 8.0 h`
pbu
CC BY-SA 3.0
2018-01-11T18:04:54.993Z
It depends on the hashrate of your computer and the difficulty you have set for the genesis block.
Ava Chow
CC BY-SA 3.0
2018-02-22T00:01:07.073Z
How to actually create genesis block?
creator
CC BY-SA 3.0
2018-02-22T00:02:18.583Z
How to lower difficulty for fast genesis block?
creator
CC BY-SA 3.0
2018-01-10T18:48:51.727Z
2018-01-10T18:48:51.727Z
Ava Chow
<p>I am trying to create a new crypto currency and i am struggling with creating genesis block with the bitcoin code. I am following this tutorial <a href="https://bitcointalk.org/index.php?topic=225690.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=225690.0</a> and i believe the code is quite old.</p>

<p>I have changed the parameters and </p>

<pre><code>genesis = CreateGenesisBlock(1515428732, 2018236893, 0x1d00ffff, 1, 50 * COIN);
   consensus.hashGenesisBlock = genesis.GetHash("");
   assert(consensus.hashGenesisBlock == uint256S(""));
   assert(genesis.hashMerkleRoot == uint256S(""));
</code></pre>

<p>but it is not compiling</p>

<pre><code>chainparams.cpp:240:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;
    ^
chainparams.cpp:333:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;
</code></pre>

<p>I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.</p>

<pre><code>229tx)
2017-09-07 13:40:39 UpdateTip: new best=00000000000008838dc29dd8f585e69dc53731d6de106179c6a76b1b20c31396 height=177243 version=0x00000001 log2_work=68.044269 tx=2915938 date='2012-04-26 03:22:53' progress=0.011538 cache=210.7MiB(789124tx)
2017-09-07 13:40:39 UpdateTip: new best=0000000000000729fce8abd24f2abb7f1080f603a7d5f75794c79afec3efbadd height=177244 version=0x00000001 log2_work=68.044301 tx=2915981 date='2012-04-26 03:11:31' progress=0.011539 cache=210.7MiB(789104tx)
2017-09-07 13:40:39 UpdateTip: new best=000000000000016217c799e6d414cbd420da4a134a3b1a9b30f728b7da81d6d9 height=177245 version=0x00000001 log2_work=68.044333 tx=2916006 date='2012-04-26 03:09:07' progress=0.011539 cache=210.7MiB(789117tx)
</code></pre>

<genesis-block><source-code>
How to Create New Genesis Block?
pbu
# How to Create New Genesis Block?

(Asked by: username_0 on 2018-01-10)

I am trying to create a new crypto currency and i am struggling with creating genesis block with the bitcoin code. I am following this tutorial https://bitcointalk.org/index.php?topic=225690.0 and i believe the code is quite old.
I have changed the parameters and 
genesis = CreateGenesisBlock(1515428732, 2018236893, 0x1d00ffff, 1, 50 * COIN);
   consensus.hashGenesisBlock = genesis.GetHash("");
   assert(consensus.hashGenesisBlock == uint256S(""));
   assert(genesis.hashMerkleRoot == uint256S(""));

but it is not compiling
chainparams.cpp:240:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;
    ^
chainparams.cpp:333:54: error: too many arguments to function call, expected 0, have 1
        consensus.hashGenesisBlock = genesis.GetHash("");
                                     ~~~~~~~~~~~~~~~ ^~
./primitives/block.h:63:5: note: 'GetHash' declared here
    uint256 GetHash() const;

I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.
229tx)
2017-09-07 13:40:39 UpdateTip: new best=00000000000008838dc29dd8f585e69dc53731d6de106179c6a76b1b20c31396 height=177243 version=0x00000001 log2_work=68.044269 tx=2915938 date='2012-04-26 03:22:53' progress=0.011538 cache=210.7MiB(789124tx)
2017-09-07 13:40:39 UpdateTip: new best=0000000000000729fce8abd24f2abb7f1080f603a7d5f75794c79afec3efbadd height=177244 version=0x00000001 log2_work=68.044301 tx=2915981 date='2012-04-26 03:11:31' progress=0.011539 cache=210.7MiB(789104tx)
2017-09-07 13:40:39 UpdateTip: new best=000000000000016217c799e6d414cbd420da4a134a3b1a9b30f728b7da81d6d9 height=177245 version=0x00000001 log2_work=68.044333 tx=2916006 date='2012-04-26 03:09:07' progress=0.011539 cache=210.7MiB(789117tx)

**Tags:** genesis-block, source-code


---

## 1 answers

### Answer by username_1 on 2018-01-10. Score: 2 | Accepted answer

genesis.GetHash("");

This is incorrect. GetHash does not take a parameter, as said in the compiler error. This should just be genesis.GetHash();.

I have checked the debug.log but i dont see new values for hashGenesis and Merkel root.

The debug.log file is only modified when  you run the program, and because it isn't even compiling, when you run it, you are not running it with any of your changes.

> **Comments:**
> **username_0**: How much time it takes to create hash of genesis block? I am using this script https://github.com/lhartikk/GenesisH0  but stuck for 8 hrs. `algorithm: SHA256 merkle hash: 7d8d77f82fff1c303f864fcd9e48f2e20c50ff91c7144fc0bb8092205662dc33 pszTimestamp: Democracy Now 03/Jan/2018 Trump Administration Will Withhold Pakistan Military Aid pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f time: 1515428732 bits: 0x1d00ffff Searching for genesis hash.. 149739.0 hash/s, estimate: 8.0 h`  
> **username_1**: It depends on the hashrate of your computer and the difficulty you have set for the genesis block.  
> **username_2**: How to actually create genesis block?  
> **username_2**: How to lower difficulty for fast genesis block?  

---

