⚠️ Important: Make sure to add both paths to your system's PATH variable for the tools to work from command line.
Understanding the Genesis Block
What is a Genesis Block?
The Genesis Block is the very first block in a blockchain network. It serves as the foundation for all subsequent blocks.
Key Characteristics
Block #0: Always numbered as block zero
No Parent: Has no previous block to reference
Network Configuration: Defines the rules for your private network
JSON Format: Written in JavaScript Object Notation
💡 Think of it as: The "constitution" of your blockchain network - it establishes the fundamental rules and parameters that all network participants must follow.
What We'll Configure
Network ID and chain configuration
Mining difficulty and gas limits
Initial account allocations
Consensus mechanism parameters
Genesis Block Parameters Explained
🔗 chainId
Protects against replay attacks by ensuring transactions are unique to this network.
🏠 homesteadBlock
Ethereum's second major release. Value 0 means using this version from genesis.
⛏️ difficulty
Mining difficulty in hex (0x20000 = 131,072). Lower values make mining faster for testing.
⛽ gasLimit
Maximum gas allowed per block (0x2fefd8 = 3,141,592). High values avoid limits during testing.
🎯 nonce
Cryptographic proof-of-work value. Shows computational effort was expended.
💰 coinbase
Address receiving mining rewards. Can be anything in genesis block.
⏰ timestamp
Unix timestamp of block creation. Helps maintain consistent block timing.
🔗 parentHash
Hash of previous block. Always zeros for genesis block since it has no parent.
Creating the Genesis Block
Step 1: Create the JSON File
Download the genesis file or create myGenesis.json:
📁 Created Folder: After successful initialization, you'll find an "Ethereum" folder at: C:\Users\[username]\AppData\Roaming\Ethereum
⚠️ Troubleshooting: If you encounter errors, delete the Ethereum folder (or just the chaindata subfolder) and re-run the init command.
Starting Your Private Network
Launch the Network
geth --networkid=5 console
Command Breakdown
geth - Runs the Go Ethereum client
--networkid=5 - Sets unique network ID (avoid 1 = mainnet)
console - Opens interactive JavaScript console
🌐 Network ID Guidelines:
• ID 1 = Ethereum Mainnet (avoid!)
• Use any other number for your private network
• All nodes must use the same network ID to connect
What You'll See
The console will display initialization messages and present a JavaScript prompt where you can interact with your blockchain.
Launching Ethereum Wallet
Start the Wallet Application
Navigate to your Ethereum Wallet installation folder
Run Ethereum Wallet.exe
The wallet will automatically detect your running private network
Wait for the interface to fully load
🔄 Synchronization: The wallet needs to sync with your private blockchain. Since you just started it, this should be very quick.
What You'll See
Clean wallet interface with zero balance
Network status showing your private network
Options to create accounts and deploy contracts
Block number should start at 0 (genesis block)
⚠️ Remember: Keep your geth console running in the background while using the wallet!
Creating Your First Account
Method 1: Using Ethereum Wallet
Open the Ethereum Wallet application
Navigate to the "Wallets" section
Click "Add Account"
Follow the prompts to create a new account
Set a strong password and save it securely!
Method 2: Using Geth Console
geth account new
🔐 Security Note: Your account password is crucial! Without it, you cannot access your account or funds. Store it in a safe place.
💰 Mining Rewards: Each block you mine will give you Ether rewards. Since you're on a private network with low difficulty, mining will be much faster than on the main Ethereum network.
Monitor Your Progress
Watch the console for mining messages
Check your wallet balance increasing
Observe the block number growing
Managing Mining & Next Steps
Stop Mining
When you want to stop mining, use either:
miner.stop()
Or press Ctrl+C in the console
🎉 Congratulations!
You've successfully set up your private Ethereum blockchain! Here's what you've accomplished:
✅ Installed all required tools
✅ Created a custom genesis block
✅ Started your private network
✅ Created Ethereum accounts
✅ Mined your first blocks
What's Next?
Deploy smart contracts to your network
Create multiple accounts and transfer Ether
Experiment with different mining parameters
Connect multiple nodes to create a network
Explore DApp development on your private chain
🚀 You now have your own Ethereum blockchain running!