首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >失败的RLPx握手

失败的RLPx握手
EN

Ethereum用户
提问于 2018-03-09 21:49:57
回答 1查看 1.5K关注 0票数 1

我试图在我的网站后端使用https://github.com/kesar/ethereum-php

我按照教程http://iotbl.blogspot.ca/2017/03/setting-up-private-ethereum-testnet.html在UbuntuServer16.04上建立了两个本地链。

这就是geth版本打印的内容:

代码语言:javascript
复制
Geth
Version: 1.8.2-stable
Git Commit: b8b9f7f4476a30a0aaf6077daade6ae77f969960
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.9.4
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.9

我就是这样开始锁链的:

geth无发现-详细的9-networkid 50000 -端口50000 -datadir Chain02 01/控制台geth -无发现-详细的9-networkid 50000 -端口50001 -datadir Chain02 02/控制台

我能够为chain2添加一个对等终端,并命令net.peerCount按预期显示1。

通过这种工作,我试图通过https://github.com/kesar/ethereum-php/blob/master/README.md,并遇到了一个超时。这是我的PHP代码:

代码语言:javascript
复制
$client = new EthereumClient('http://127.0.0.1:50000');
$iBlockNum = $client->eth()->blockNumber() ;

这就是我在geth日志中看到的:

代码语言:javascript
复制
TRACE[03-08|15:56:06] Accepted connection addr=127.0.0.1:43610
TRACE[03-08|15:56:11] Failed RLPx handshake addr=127.0.0.1:43610 conn=inbound err="read tcp 127.0.0.1:50000->127.0.0.1:43610: i/o timeout"
TRACE[03-08|15:56:11] Setting up connection failed id=0000000000000000 err="read tcp 127.0.0.1:50000->127.0.0.1:43610: i/o timeout"

这就是wireshark所显示的从端口43610发送到端口50000的情况:

{"jsonrpc":"2.0",“方法”:“eth_blockNumber”,"id":83}

但是端口50000没有回复。

我正在Eclipse中调试的另一个细节。不确定它是否能影响互动。

另一件事:当我连接到http://truffleframework.com/ganache/时,上面的php代码工作得很好。

EN

回答 1

Ethereum用户

发布于 2018-03-11 19:57:40

我犯了个错误。下面是允许php客户端连接的选项:

代码语言:javascript
复制
geth --nodiscover --verbosity 9 --networkid 50000 --datadir ./Chain01/ --rpcvhosts "127.0.0.1,::1" --rpc --rpcapi db,eth,net,web3,personal --cache=1024 --rpcport 50000 --rpcaddr 127.0.0.1 --rpccorsdomain "*"   
票数 1
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/42275

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档