How to Set Up an Ethereum Private Blockchain with Geth on Windows 10, Connect to a Wallet, and Mine ETH – Step-by-Step Guide

·

Setting up your own Ethereum private blockchain is a powerful way to learn blockchain fundamentals, test smart contracts, and simulate decentralized applications (DApps) in a controlled environment. This comprehensive tutorial walks you through the entire process using the Geth client on Windows 10, including creating a genesis block, initializing the network, connecting a wallet like MetaMask, and starting mining operations.

Whether you're a developer, student, or blockchain enthusiast, this guide ensures a smooth and educational experience—no prior deep expertise required.


Download and Install the Geth Client

The first step is installing the official Ethereum Go client (Geth), which enables you to run a full Ethereum node.

👉 Get started with blockchain development tools today.

Visit the official download page: https://geth.ethereum.org/downloads/
Choose the Stable release for Windows (64-bit recommended). Download and extract the .zip file to a convenient location on your system—such as C:\Ethereum\geth.

⚠️ If the download fails, ensure that any proxy or VPN software is disabled temporarily.

Once extracted, open Command Prompt (cmd) and navigate to your Geth directory:

cd C:\Ethereum\geth

Test the installation by running:

geth -help

If help documentation appears, your installation was successful.

You can optionally test syncing with the main Ethereum network by running geth, but for private chain setup, we’ll skip full synchronization.

By default, Geth stores data in:

C:\Users\[YourUsername]\AppData\Roaming\Ethereum

Enable viewing of hidden folders in File Explorer to access AppData.


Create a Genesis Configuration File

A genesis block defines the initial state of your private blockchain. All nodes in your network must use the same genesis file to stay in sync.

Close any running Geth instances before proceeding.

In your Geth folder, create a new file named genesis.json with the following content:

{
  "config": {
    "chainId": 8434,
    "homesteadBlock": 1,
    "eip150Block": 2,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 3,
    "eip158Block": 3,
    "byzantiumBlock": 4,
    "alien": {
      "period": 2,
      "epoch": 300,
      "maxSignersCount": 5,
      "minVoterBalance": 100000000000000000000,
      "genesisTimestamp": 1536136198,
      "signers": [
        "393faea80893ba357db03c03ee73ad3e31257469",
        "30d342865deef24ac6b3ec2f3f8dba5109351571",
        "d410f95ede1d2da66b1870ac671cc18b66a97778"
      ]
    }
  },
  "nonce": "0x0",
  "timestamp": "0x5b8f92c2",
  "extraData": "0x000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x47b760",
  "difficulty": "0x1",
  "mixHash": "0x63746963616c2d62797a616e74696e652d686173682d6f662d7a65726f",
  "coinbase": "Winning Address",
  "alloc": {
    "cbfc29c31a31c869f9eb59a" : { "balance": "115792895e+54" },
    "393faea8" : { "balance": "115792895e+54" },
    "393faea8" : { "balance": "115792895e+54" },
    "d41f95ed" : { "balance": "115792895e+54" }
  },
  "number": "x",
  "gasUsed": "x",
  "parentHash": ""
}

Key Parameters Explained

This configuration ensures fast block generation and easy testing.


Initialize the Blockchain

Open cmd in your Geth directory and run:

geth --datadir .\db init genesis.json

This command creates a new data directory (db) containing:

Initialization confirms your genesis block is valid.


Launch Your Private Node

Start the Geth node with RPC interfaces enabled for interaction:

geth --http --http.api db,eth,net,web3,personal --datadir .\db --networkid 8434 console >> geth.log 2>&1

Parameter Breakdown

After startup, verify node status:

admin.nodeInfo

You should see network and peer information confirming operation.


Create or Import an Account

Check existing accounts:

eth.accounts

If empty, create one:

personal.newAccount("your-password")
🔐 Use a simple password for testing; never use real secrets in development.

To connect with MetaMask, export a private key from MetaMask and import it into Geth:

geth account import [path-to-private-key.txt]

Then move the generated keyfile from the default location to your .\db\keystore folder.

List imported accounts:

eth.accounts

They now exist on your private chain.


Connect MetaMask to Your Local Chain

👉 Discover how wallets interact with private Ethereum networks.

MetaMask doesn’t natively detect local chains. To connect:

  1. Open MetaMask → Network dropdown → “Custom RPC”.
  2. Add:

    • Network Name: Localhost 8545
    • New RPC URL: http://localhost:8545
    • Chain ID: 8434
    • Save.

Now import the account whose private key you imported into Geth.

Your balance should reflect pre-allocated funds or mining rewards.


Start Mining Ether Locally

Mining generates new blocks and rewards the coinbase address.

Set your preferred mining address:

miner.setEtherbase("your-account-address")

Begin mining with one CPU thread:

miner.start(1)

Switch back to MetaMask or check in console:

eth.getBalance(eth.accounts[ ])

You'll observe increasing balances every few seconds due to low difficulty.

Stop mining when needed:

miner.stop()

Frequently Asked Questions (FAQ)

Q: Why do I need a unique chainId and networkId?
A: To avoid conflicts with public Ethereum and other private networks. Nodes only connect if these IDs match.

Q: Can I run this on macOS or Linux?
A: Yes! The process is nearly identical—only file paths and terminal commands vary slightly.

Q: Is mining profitable on a private chain?
A: Not financially—it’s for learning. The Ether has no real-world value but simulates economic behavior.

Q: What if MetaMask shows zero balance after import?
A: Ensure the network points to http://localhost:8545 and chain ID matches. Refresh or re-import the account.

Q: How do I add more accounts with initial funds?
A: Modify the alloc section in genesis.json before initialization, specifying more addresses and balances in wei.

Q: Can I deploy smart contracts on this chain?
A: Absolutely. With Remix IDE or Truffle connected via HTTP-RPC, you can deploy and test contracts locally.


Final Thoughts

You’ve now built a fully functional Ethereum private blockchain using Geth on Windows 1 . From setting up the client and crafting a custom genesis block to integrating MetaMask and mining Ether, each step builds foundational knowledge crucial for blockchain development.

This environment serves as a sandbox for experimenting with DApps, consensus mechanisms, and decentralized identity—all without cost or risk.

👉 Take your blockchain skills further—explore development tools and resources.

With everything configured, you’re ready to dive into smart contract programming or multi-node network simulation next.