Background Knowledge
Ethereum is an open-source, decentralized blockchain platform featuring smart contract functionality. Its native cryptocurrency, Ether (ETH), powers the Ethereum Virtual Machine (EVM) for executing peer-to-peer contracts. Proposed in 2013-2014 by Vitalik Buterin, Ethereum was crowdfunded in 2014 as a "next-generation cryptocurrency and decentralized application platform."
Part 1: Linux Setup Guide (Ubuntu 16.04)
Prerequisites
- Ubuntu 16.04 64-bit OS
- Geth (Go-Ethereum) client
Installation Steps
Install Dependencies:
sudo apt-get install software-properties-commonAdd Ethereum Repository:
sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get updateInstall Geth:
sudo apt-get install ethereumInitialize Blockchain:
Create directories:
mkdir Mychain && cd Mychain mkdir mydataGenerate
genesis.json:{ "config": { "chainId": 10, "homesteadBlock": 0, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, "istanbulBlock": 0, "ethash": {} }, "nonce": "0x0", "timestamp": "0x5e4a53b2", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x47b760", "difficulty": "0x80000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "0000000000000000000000000000000000000088": { "balance": "0x200000000000000000000000000000000000000000000000000000000000000" } }, "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }Initialize chain:
geth --datadir mydata init genesis.json
Geth Console Operations
Start Private Node:
geth --identity "TestNode" --rpc --rpcport "8545" --datadir mydata --port "30303" --networkid 6666 --nodiscover console --allow-insecure-unlockFlags explained:
--identity: Node identifier--nodiscover: Disables peer discovery for private networks
Account Management:
Create account:
personal.newAccount("123")List accounts:
eth.accounts
Mining:
Set miner address:
miner.setEtherbase(eth.accounts[0])Start/stop mining:
miner.start() miner.stop()
Transactions:
Check balances (Wei):
eth.getBalance(eth.accounts[0])Send ETH (unlock account first):
personal.unlockAccount(eth.accounts[0]) eth.sendTransaction({from:eth.accounts[0], to:eth.accounts[1], value:web3.toWei(7,'ether')})Process pending transactions:
miner.start(1);admin.sleepBlocks(1);miner.stop();
Part 2: Windows Setup Guide
Prerequisites
Initialization
Initialize genesis block:
geth --datadir "%cd%\chain" init genesis.jsonStart node:
geth --identity "TestNode" --rpc --rpcport "8545" --datadir chain --port "30303" --networkid 6666 --nodiscover console
GUI Wallet
- Launch
Ethereum-Wallet.exeto interact with your private network (look for "PRIVATE-NET" indicator).
FAQs
Q1: Why choose a private Ethereum chain?
A: Private chains allow testing smart contracts and dApps without using real ETH or exposing data to public networks.
Q2: How to speed up mining on a private chain?
A: Lower the difficulty in genesis.json to reduce computational requirements.
Q3: Can I connect Linux and Windows nodes?
A: Yes, ensure they share the same networkid and connect manually via admin.addPeer().
๐ Explore advanced blockchain tools for enterprise solutions.
๐ Learn about smart contract development with our developer guides.