Private Ethereum Network Tutorial

Setting Up a Private Ethereum Blockchain

Create your own private Ethereum network on Windows using Geth, a custom genesis block, local accounts, private network ID and local mining for safe development experiments.

15 Tutorial sections
4 Core setup areas
1 Genesis block
Local Private network

Tutorial Overview

This tutorial guides you through creating a private Ethereum blockchain on Windows. You will install the required tools, create a genesis block, initialize a local chain, start a private network, create accounts and mine development Ether.

Private blockchain

Create a local Ethereum network for learning, testing and development.

Custom genesis block

Define the initial rules and settings for your private network.

Geth console

Run and control your Ethereum node from the command line.

Local mining

Mine private-chain Ether for experiments and testing.

Prerequisites Overview

Before setting up your private Ethereum blockchain, prepare the following components.

Node.js

JavaScript runtime used by Ethereum development tools and Web3 workflows.

Geth

Go Ethereum client used to run Ethereum nodes and private networks.

Environment Setup

Configure PATH variables so tools can be used easily from the command line.

Wallet Tools

Use a wallet interface, such as MetaMask or a legacy wallet, to interact with the network.

Installing Node.js and Development Tools

Option 1: Direct Download

Download Node.js directly from the official Node.js website.

Option 2: Using Chocolatey

Run PowerShell as Administrator and execute these commands.

Set PowerShell execution policy
Set-ExecutionPolicy Bypass
Install Chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install development tools
choco install visualstudiocode -y
choco install git -y
choco install nodejs -y
Tip: Close and reopen PowerShell after installation so new command paths are loaded.

Wallet Tools

The original tutorial uses Ethereum Mist Wallet. For modern learning, you may use a current wallet such as MetaMask to interact with a private network. If you are following the original Windows 10 steps exactly, you can keep the legacy wallet section as a historical reference.

Legacy Ethereum Wallet Setup

  1. Download the Ethereum Wallet release package.
  2. Create the folder C:\Program Files\Ethereum.
  3. Extract the wallet files to the folder.
Note: For a production-looking website, describe Mist Wallet as legacy and point new learners toward modern wallet tools.

Installing Geth

What is Geth?

Geth stands for Go Ethereum. It is the Ethereum client used in this tutorial to run the node, initialize the chain, open the console and mine blocks on your private network.

Installation Steps

  1. Download and install Geth for Windows.
  2. Use the default installation folder unless you have a specific reason to change it.
  3. Confirm the expected installation path.
Expected installation path
C:\Program Files\Geth
Key function: Geth runs your Ethereum node, mines blocks and executes smart contracts on the private chain.

Setting Up Environment Variables

Why Set PATH Variables?

Adding tools to your system PATH allows you to run commands from any command prompt location.

Steps to Configure

  1. Right-click This PC and choose Properties.
  2. Click Advanced system settings.
  3. Click Environment Variables.
  4. Select Path under System Variables.
  5. Click Edit and add the required folders.
Paths to add
C:\Program Files\Ethereum-Wallet
C:\Program Files\Geth
Important: Add the paths used by your actual installation folders. Restart the terminal after editing PATH.

Understanding the Genesis Block

What is a Genesis Block?

The genesis block is the first block in a blockchain network. It acts as the foundation for all later blocks and defines the starting rules of the private network.

Block #0

The first block is always numbered zero.

No Parent

It has no previous block to reference.

Network Configuration

It defines the rules and parameters for the private chain.

JSON Format

The configuration is written as a JSON file.

What You Configure

  • Network ID and chain configuration.
  • Mining difficulty and gas limits.
  • Initial account allocations.
  • Consensus and block parameters.

Genesis Block Parameters Explained

chainId

Protects against replay attacks by making transactions unique to this network.

homesteadBlock

Defines which protocol rules are active from the genesis block.

difficulty

Controls mining difficulty. Lower values make mining faster for testing.

gasLimit

Sets the maximum gas allowed per block.

nonce

A proof-of-work related value used in the block header.

parentHash

All zeros in the genesis block because there is no previous block.

Creating the Genesis Block

Step 1: Create the JSON File

Create a file named myGenesis.json.

myGenesis.json
{
  "config": {
    "chainId": 45,
    "homesteadBlock": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 12
  },
  "alloc": {},
  "coinbase": "0x0000000000000000000000000000000000000000",
  "difficulty": "0x20000",
  "extraData": "",
  "gasLimit": "0x2fefd8",
  "nonce": "0x0000000000000042",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}

Step 2: Save the File

Save myGenesis.json in the same working folder you will use for Geth.

Initialize the Genesis Block

Run the Initialization Command

Initialize the private chain
geth init myGenesis.json

What Happens

  • Geth reads the genesis configuration.
  • It creates the blockchain database.
  • It sets up the initial network parameters.
  • It creates the Ethereum folder structure.
Created folder
C:\Users\[username]\AppData\Roaming\Ethereum
Troubleshooting: If initialization fails, delete the Ethereum folder or the chaindata subfolder and run the init command again.

Starting Your Private Network

Launch the Network

Start Geth with private network ID
geth --networkid=5 console

Command Breakdown

  • geth: Runs the Go Ethereum client.
  • --networkid=5: Sets a private network ID.
  • console: Opens the interactive JavaScript console.
Avoid network ID 1 because it refers to Ethereum Mainnet. Use a different number for your private network.

Launch Wallet Interface

  1. Start the wallet application or connect a modern wallet to your private network.
  2. Make sure Geth is still running in the background.
  3. Confirm the wallet shows the private network and starts from the genesis block.

Creating Your First Account

Method 1: Using Wallet Interface

  1. Open your wallet tool.
  2. Navigate to the account or wallet section.
  3. Create a new account.
  4. Set a strong password and keep it safely.

Method 2: Using Geth Console

Create account from command line
geth account new

What You Get

  • Account address: Unique Ethereum-style address.
  • Private key: Stored encrypted in your keystore.
  • Initial balance: Zero ETH until you mine or allocate funds.
Security note: Keep passwords and private keys safe. Losing them means losing access to the account.

Mining Your First Blocks

Start the Mining Process

Run inside the Geth console
miner.start(1)

What This Command Does

  • miner.start() begins mining.
  • 1 uses one CPU thread.
  • New blocks are created on the private network.
  • Mining rewards are assigned to the coinbase account.

Monitor Your Progress

  • Watch the console for mining messages.
  • Check whether the wallet balance increases.
  • Observe the block number increasing.

Stop Mining

Stop mining
miner.stop()

You may also press Ctrl + C in the console when appropriate.

Conclusion and Next Steps

What You Have Accomplished

Installed tools

Prepared Node.js, Geth and supporting development tools.

Created genesis block

Defined the starting rules for your private Ethereum blockchain.

Started private network

Launched Geth with a private network ID and console access.

Mined blocks

Created accounts and mined local Ether for development use.

What to Explore Next

  • Deploy smart contracts to your private network.
  • Create multiple accounts and transfer Ether.
  • Experiment with different network and mining parameters.
  • Connect multiple nodes to form a private network.
  • Build and test DApps on your private chain.

Development Flow

Install tools
Create genesis JSON
Initialize Geth
Start private network
Create accounts and mine blocks