Bitcoin Forum
May 05, 2024, 09:00:19 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Where is the hash of the genesis block in the Bitcoin code ?  (Read 200 times)
RisitasLeGrand (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
January 11, 2018, 12:50:42 PM
 #1

Everything is in the title  Grin

Thanks in advance !  Wink
1714899619
Hero Member
*
Offline Offline

Posts: 1714899619

View Profile Personal Message (Offline)

Ignore
1714899619
Reply with quote  #2

1714899619
Report to moderator
1714899619
Hero Member
*
Offline Offline

Posts: 1714899619

View Profile Personal Message (Offline)

Ignore
1714899619
Reply with quote  #2

1714899619
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714899619
Hero Member
*
Offline Offline

Posts: 1714899619

View Profile Personal Message (Offline)

Ignore
1714899619
Reply with quote  #2

1714899619
Report to moderator
eternalgloom
Legendary
*
Offline Offline

Activity: 1792
Merit: 1283



View Profile WWW
January 11, 2018, 01:06:15 PM
 #2

Everything is in the title  Grin

Thanks in advance !  Wink
There's an entry in the Bitcoin Wiki about that, here's the link to the page: https://en.bitcoin.it/wiki/Genesis_block

So, the hash of the genesis block is: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
The Bitcoin wiki article also mentions where it's found in the code Wink

RisitasLeGrand (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
January 12, 2018, 09:46:54 AM
 #3

I don't find it, the "main.cpp" file doesn't exists anymore, I've looked for the Genesis Block hash in validation.cpp and net_processing.cpp but i don't find anything  Huh
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16596


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
January 12, 2018, 11:47:19 AM
 #4

I assume you've downloaded https://github.com/bitcoin/bitcoin, just search for the hash eternalgloom mentioned. Quick and dirty, but it works:
Code:
bitcoin-master $ for i in `find`; do grep 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f $i 2> /dev/null; done
                settings['genesis'] = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'
genesis=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
        assert(consensus.hashGenesisBlock == uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"));
    src/bitcoin-cli -named getblock blockhash=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

Or, if you want to see which files contain these lines:
Code:
bitcoin-master $ for i in `find`; do if [ -n "`grep 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f $i 2> /dev/null`" ]; then echo $i; fi; done
./contrib/linearize/linearize-data.py
./contrib/linearize/example-linearize.cfg
./src/chainparams.cpp
./doc/release-notes/release-notes-0.14.0.md

achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
January 13, 2018, 12:07:26 AM
 #5

I don't find it, the "main.cpp" file doesn't exists anymore, I've looked for the Genesis Block hash in validation.cpp and net_processing.cpp but i don't find anything  Huh
It's in chainparams.cpp

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!