1节点所在的机器,相互之间可以互联互通
2它们有相同的创世纪文件
3 有相同的networkid
一 第一个节点创建
root@i-67u87x1c:/home/ubuntu# mkdir private-geth
root@i-67u87x1c:/home/ubuntu# cd private-geth/
root@i-67u87x1c:/home/ubuntu/private-geth# vim genesis.json
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x40000",
"extraData" : "",
"gasLimit" : "0xffffffff",
"nonce" : "0x0000000000000042",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00",
"alloc": { }
}
初始化创始块
root@i-67u87x1c:/home/ubuntu/private-geth# geth --datadir ./data/00 init genesis.json
WARN [07-06|14:38:34] No etherbase set and no accounts found as default
INFO [07-06|14:38:34] Allocated cache and file handles database=/home/ubuntu/private-geth/data/00/geth/chaindata cache=16 handles=16
INFO [07-06|14:38:34] Writing custom genesis block
INFO [07-06|14:38:34] Successfully wrote genesis state database=chaindata hash=a0e580鈥5e82e
INFO [07-06|14:38:34] Allocated cache and file handles database=/home/ubuntu/private-geth/data/00/geth/lightchaindata cache=16 handles=16
INFO [07-06|14:38:34] Writing custom genesis block
INFO [07-06|14:38:34] Successfully wrote genesis state database=lightchaindata
进入geth后面连接节点
root@i-67u87x1c:/home/ubuntu/private-geth# geth --datadir ./data/00 --networkid 314590 --ipcdisable --port 632 --rpcport 8156 --bootnodes "enode://96f7a95a8c5e7a1f911142d87ce53ae882568be0435016e4803a6d410a9ecc7a69322cee8efbe8499ec7c737c377793182cab8869a076389c6b47626df00450b@192.168.0.4:61910" console
WARN [07-06|14:43:54] No etherbase set and no accounts found as default
INFO [07-06|14:43:54] Starting peer-to-peer node instance=Geth/v1.6.6-stable-10a45cb5/linux-amd64/go1.8.1
INFO [07-06|14:43:54] Allocated cache and file handles database=/home/ubuntu/private-geth/data/00/geth/chaindata cache=128 handles=1024
INFO [07-06|14:43:54] Initialised chain configuration config="{ChainID: 15 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: 0 EIP158: 0 Metropolis: <nil> Engine: unknown}"
INFO [07-06|14:43:54] Disk storage enabled for ethash caches dir=/home/ubuntu/private-geth/data/00/geth/ethash count=3
INFO [07-06|14:43:54] Disk storage enabled for ethash DAGs dir=/root/.ethash count=2
INFO [07-06|14: