【发布时间】:2018-08-14 17:18:39
【问题描述】:
我想将本地 Geth 实例连接到我在 ubuntu 服务器上的私有以太坊网络。
系统信息Geth 版本:1.8.12
操作系统和版本:Ubuntu 18.4
本地 Geth 节点是非矿工节点,我想通过该节点将交易发送到我服务器上的专用网络(由 Geth 节点组成)。
实际行为我本地GethNode的net.peerCount返回0
我使用 bootnode 连接所有节点,如 --bootnode-flag 所示
运行服务器 Geth 节点:
geth --datadir "./ethnode1" --networkid 2061 --port 30304 --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcport 8545 --rpcapi="db,eth,net,web3,personal,web3" --ipcpath "./ethnode1/geth.ipc" --mine --minerthreads 1 --gasprice "10000" --etherbase 0xa17ae57bfb4a63b8cbd0c79bc74440791a2a6115 --verbosity 3 --bootnodes "enode://08622fab0c0b4f6268976eb8678ae4bc72271d726825d4a8a60034a7436ae199081294c4c35875a2ca65e8f2bfee3e7d26f727d96a39815d523b150805aff913@server-ip:30301"
geth --datadir "./ethnode2" --networkid 2061 --port 30305 --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcport 8546 --rpcapi="db,eth,net,web3,personal,web3" --ipcpath "./ethnode2/geth.ipc" --mine --minerthreads 1 --gasprice "10000" --etherbase 0x6451cb262925d2ad23747240035f52e1a5e3f1d3 --verbosity 3 --bootnodes "enode://08622fab0c0b4f6268976eb8678ae4bc72271d726825d4a8a60034a7436ae199081294c4c35875a2ca65e8f2bfee3e7d26f727d96a39815d523b150805aff913@erver-ip:30301"
运行本地 Geth 节点:
geth --datadir "./localnode" --networkid 2061 --ws --wsaddr externalip --rpc --rpcaddr externalip --rpccorsdomain "*" --wsapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --bootnodes "enode://08622fab0c0b4f6268976eb8678ae4bc72271d726825d4a8a60034a7436ae199081294c4c35875a2ca65e8f2bfee3e7d26f727d96a39815d523b150805aff913@serverip:30301"
[backtrace]
【问题讨论】:
-
我尝试了 admin.addPeer("enode://enodekey@serverip:port") 但我没有将我电脑上的 geth-node 连接到我服务器上的 geth-nodes...
-
不看日志就很难判断。
标签: ethereum go-ethereum geth