我想在我的本地网络上部署一个智能合约。我通过执行一个本地节点
PRIVATE_CONFIG=ignore nohup geth --datadir ./Node1/new-
node-1
--nodiscover --verbosity 5 --networkid 31337 --raft --
raftport 51001 --rpc --rpcaddr 0.0.0.0 --rpcport 22101 --
rpcapi
admin,db,eth,debug,miner,net,shh,txpool,personal,web3,
quorum,raft --emitcheckpoints --port 21101 2>>node1.log &我必须使用localhost:\127.0.0.1:21101还是22101?我想知道这两个端口有什么不同,是用来做什么的?
如果您不介意的话,还有一个问题:当我使用端口21101时,它无法连接,当我查阅节点日志时,我发现:
Failed RLPx handshake addr=[::1]:42552 conn=inbound
err="read tcp [::1]:21102->[::1]:42552: i/o timeout"发布于 2019-12-13 15:43:36
您需要使用RPC端口号来连接网络。
For examples: http://localhost:22101
Raft端口和RPC端口之间的差异-
默认情况下,
仲裁在端口50400上侦听raft传输,但这可以使用
--raftport标志进行配置。您可以使用--rpc标志启动HTTP JSON-RPC,以更改默认端口(8545)--rpcport <portnumber>如果从浏览器访问RPC,则需要使用适当的域设置启用CORS。否则JavaScript调用会受到同源策略的限制,请求会失败:
For examples: geth --rpc --rpccorsdomain "http://localhost:3000"
尝试使用http://remix.ethereum.org/连接本地网络(不安全的网络)。如果启用了Https证书,则可以使用https://remix.ethereum.org/
https://stackoverflow.com/questions/56445079
复制相似问题