说明
peer节点意思是同一genesis.json/同一链上的不同账户
操作流程
在两个终端窗口分别操作,下面的账号的信息换成你实际执行时的accout和node信息
节点1
1 | geth --datadir ./data/00 init genesis.json |
查看ip
ifconfig|grep netmask|awk ‘{print $2}’1
2
3
4
5
6
7
8
9
10
11net.peerCount
admin.peers
eth.getBalance(eth.coinbase)
eth.blockNumber
miner.start()
miner.stop()
personal.unlockAccount("0x2d0a5dbffe1219e80f7830a8bb8d288c61f5a89b")
eth.blockNumber
eth.getBalance(eth.coinbase)
eth.sendTransaction({from: "0x2d0a5dbffe1219e80f7830a8bb8d288c61f5a89b", to: "0xa1defe64a7253df824b91761b579bc6a49339abb", value: web3.toWei(1, "ether")})
miner.start()
稍等10秒钟,让挖点矿1
2
3miner.stop()
eth.getBalance(eth.coinbase)
eth.blockNumber
节点2
1 | geth --datadir ./data/01 init ./genesis.json |