Build Genesis Block Manually

This section describes how to build the genesis block manually to start a new private Ethereum network.

In order to create a private Ethereum network with a lower difficult level, I need to do the following:

1. Stop the running "geth" node from the JavaScript console:

> exit

2. Tear down the current blockchain on my private network:

C:\>"\program files\geth\geth.exe" removedb 
   --datadir \herong\Ethereum\personal 2>> ether-personal.log

Remove this database? [y/N] y

3. Create the genesis block file in JSON format:

C:\>type \herong\ethereum\personal\genesis.json	

    "config": {
        "chainId": 314,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    "difficulty": "1000000",
    "gasLimit": "1000000",
    "alloc": {}

3. Initialize the private network with this genesis block file:

C:\>"\Program Files\geth\geth" 
   init \herong\ethereum\personal\genesis.json 
   --datadir \herong\Ethereum\personal 2>> ether-personal.log

4. Start the "geth" node:

C:\>"\Program Files\geth\geth" console 
   --datadir \herong\Ethereum\personal 2>> ether-personal.log


5. Verify the genesis block:

> eth.getBlock(0).difficulty

> eth.getBlock(0).transactions

Excellent! The difficult level of the genesis block is much smaller now.

Last update: 2018.

Table of Contents

 About This Book

 Introduction of Ethereum

 Ethereum Blockchain

 Ethereum Mist Wallet

 geth - Go Ethereum

 Testnet - Ropsten network

 Private Ethereum Network

 64-Bit "geth" for Private Ethereum Network

Private Network with Custom Genesis Block

Build Genesis Block Manually

 Run "miner" with Lower Difficulty

 Check Mining Rewards on My Account

 Pre-Allocate Ether in Genesis Block

 Build Ethereum Private Network Properly

 Blockchain Difficulty Level and Growth Rate

 "Head State Missing" Error on Restarting "geth"

 Download and Install "geth" 1.8.2

 Run and Restart with "geth" 1.8.2

 Transferring Funds between Ether Accounts

 MetaMask - Browser Based Ethereum Wallet

 Managing Ethereum Account - Mining Ether with Browser


 PDF Printing Version