How to get genesis block value at new bitcoin source?

0 votes

I am working bitcoin source 0.15.1

chainparams.cpp script, how to get to know my genesis block value?

Sep 4, 2018 in Blockchain by slayer
• 29,050 points
61 views

1 answer to this question.

0 votes

chainparams.cpp contains a line of code that checks whether the chain’s genesis block is equal to a specified hash.

You can see an example for the line here:

 hashGenesisBlock = genesis.GetHash();
 assert(hashGenesisBlock == uint256("9915158279673d101912be80f25c20627f1dd8bf5231e7c46bfec5ed19737f44"));

To print it the hash of the genesis block, you can use

printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());

Which prints the genesis block in terminal or debug.log

answered Sep 4, 2018 by digger
• 27,630 points

Related Questions In Blockchain

0 votes
1 answer

How to get current block number in parity?

You can get the latest block number ...READ MORE

answered Jun 8, 2018 in Blockchain by Christine
• 15,790 points
183 views
0 votes
1 answer

How to get return value of external function?

You can do this. I have shared ...READ MORE

answered Aug 13, 2018 in Blockchain by digger
• 27,630 points
23 views
0 votes
1 answer

How to get return value from solidity contract?

Once you call a constant function, you ...READ MORE

answered Aug 16, 2018 in Blockchain by slayer
• 29,050 points
431 views
0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,790 points
25 views
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
63 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
126 views
0 votes
1 answer
0 votes
1 answer

How to get current value of bitcoin?

You can use json_decode to transform it ...READ MORE

answered Aug 20, 2018 in Blockchain by digger
• 27,630 points
45 views
0 votes
1 answer

How to create a Genesis Block in a Private Network?

{     "nonce": "0x0000000000000042",     "difficulty": "0x000000100",     "alloc": {     },     "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",     "coinbase": "0x0000000000000000000000000000000000000000",     "timestamp": "0x00",     "parentHash": ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 27,630 points
161 views