六、peer节点转账操作

说明

peer节点意思是同一genesis.json/同一链上的不同账户

操作流程

在两个终端窗口分别操作,下面的账号的信息换成你实际执行时的accout和node信息

节点1

1
2
3
4
5
6
geth --datadir ./data/00 init genesis.json
geth --datadir ./data/00 --networkid 314590 --ipcdisable --port 61910 --rpcport 8200 console
personal.listAccounts
personal.newAccount("123456")
personal.listWallets
admin.nodeInfo.enode

查看ip
ifconfig|grep netmask|awk ‘{print $2}’

1
2
3
4
5
6
7
8
9
10
11
net.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
3
miner.stop()
eth.getBalance(eth.coinbase)
eth.blockNumber

节点2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
geth --datadir ./data/01 init ./genesis.json
geth --datadir ./data/01 --networkid 314590 --ipcdisable --port 61911 --rpcport 8101 console

personal.listAccounts
personal.newAccount("123456")
personal.listWallets

net.peerCount
admin.peers

admin.nodeInfo
admin.addPeer("enode://5b853e0c296c5a8eedbf41b2d408d231f5a860977b8efa1752f4a2daabdcba164da154684d3d365dfedd6ad27d856ab430e3f42dec58b285b5138349bcaf340c@[::]:61910")

eth.getBalance(eth.coinbase)
eth.blockNumber
坚持原创技术分享,您的支持将鼓励我继续创作!