我已经使用以下步骤在hetzner服务器上使用Ubuntu20.04BSc在主网上设置了BSC完整节点:https://www.quicknode.com/guides/infrastructure/how-to-run-a-binance-smart-chain-node
但是,我既不能将元请求连接到节点,也不能通过ws连接。我在这两种协议上都收到了“错误发生了”,我还试图通过python中的脚本进行连接,并且我无法用这两种协议连接到节点。我假设问题是我的服务器不允许其他人连接到节点。如果我在服务器上运行附加http://127.0.0.1:8545',就会得到:
instance: Geth/v1.1.8-859186f2-20220128/linux-amd64/go1.18
at block: 16566352 (Fri Apr 01 2022 14:40:07 GMT+0200 (CEST))
modules: eth:1.0 net:1.0 parlia:1.0 rpc:1.0 txpool:1.0 web3:1.0
如果我执行'eth.syncing‘,就会得到'false',这应该是正常的,因为节点已经同步了。
这是我的日志
根据堆栈溢出提供的一些答案,我还尝试使用以下参数运行geth,但没有成功:geth --config ./config.toml --datadir ./node --cache 18000 --rpc.allow-unprotected-txs --txlookuplimit 0 --http --http.addr "0.0.0.0" --http.corsdomain "\*" --http.port "8545"
发布于 2022-04-06 12:21:57
我已经发现了这个问题,如果有人偶然发现相同的情况或接近它,你可能会想试试。
这个问题发生在我的RPC http请求的config.toml上,默认情况下,HTTPHost = " localhost“和HTTPVirtualHosts = "localhost”字段在config.toml文件中,我已经用服务器的外部IP替换了localhost,它运行得非常完美。您还可以用0.0.0.0替换它。
然后,我使用以下参数执行geth:--config ./config.toml --datadir ./node --ws --ws.origins=* --rpcvhosts=* --cache 18000 --rpc.allow-unprotected-txs --txlookuplimit 0
--ws --ws.origins=*
参数也使我能够使用websocket协议连接到节点。
https://stackoverflow.com/questions/71707296
复制相似问题