geth --rpcaddr

当想要实现从另一台电脑连接本电脑上开启的geth客户端时,需要将--rpcaddr设置为本电脑的ip地址,如下:

geth --datadir data0 --networkid 1500 --port 61912 --rpc --rpcaddr 10.244.213.34 --rpcapi 'eth,net,web3,admin,personal,miner,debug' --rpccorsdomain '*' --rpcport 8202 dumpconfig > ./geth.toml 

注意不能写成:

--rpcaddr '10.244.213.34'

否则运行下面的命令的时候会报错:

Fatal: Error starting protocol stack: listen tcp: lookup 10.244.213.34--rpcapi: no such host

 

不带引号

然后运行:

geth --config geth.toml console 2>>geth.log

然后就可以从日志中看见看见:

tail -f geth.log

INFO [12-12|16:34:08] HTTP endpoint opened                     url=http://10.244.213.34:8202            cors=* vhosts=localhost

 

如果不是这样的话,从另一台电脑连接时总是报错:ERR_CONNECTION_REFUSED

转载于:https://www.cnblogs.com/wanghui-garcia/p/10109306.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值