Initialize a founding block: Geth-datadir dataname init genesis.json
Genesis.json file contents:
{
"config": {
"Chainid": "Homesteadblock": 0,
"Eip155block": 0,
"Eip158block": 0
},
"Coinbase": "0x000000000000000000000000 0000000000000000 ",
" difficulty ":" 0x40000 ",
" Extradata ":" ",
" Gaslimit ":" 0xFFFFFFFF ",
" nonce ":" 0 x0000000000000042 ",
" Mixhash ":" 0x0000000000000000000000000000000000000000000000000000000000000000 ",
" Parenthash ":" 0x0000000000000000000000000000000000000000000000000000000000000000 ",
" timestamp ":" 0x00 ",
" Alloc ": {}
}
Mixhash : Hash used with nonce for mining, generated by a portion of the previous block. Note that he and the nonce settings need to meet Ethereum's yellow paper, 4.3.4. Block Header Validity, (44) The conditions described in the chapter:
nonce : Nonce is a 64-bit random number for mining, note that he and Mixhash settings need to meet ethereum yellow paper, 4.3.4. Block Header Validity, (44) The conditions described in the chapter.
Difficulty : The difficulty of setting the current block, if the difficulty is too large, the CPU is difficult to mine, set a smaller difficulty
Alloc : The number of ethereum used to provision the account and account, Because the private chain mining is relatively easy, so we do not need to pre-set a coin account, the need to create their own can be.
Coinbase : The miner's account, please fill in the blanks
timestamp : Set the timestamp for the Genesis block
Parenthash : The hash value of the previous chunk, because it is a Genesis block, so this value is 0extraData: additional information, fill in, can fill your personality information, must be 16 binary bit string
gaslimit : This value sets the total consumption limit for gas, which is used to limit the sum of the transaction information that the block can contain, since we are the private chain, so fill the maximum.