我可以从另一台计算机连接到我的BSC完整节点
我已经使用此处提供的步骤在使用Ubuntu 20.04 BSC上的Hetzner服务器上的主网上设置了一个BSC完整节点: https://www.quicknode.com/guides/guides/infrastructure/how-to-to-run-a-a-a-binance-smart-chain-node-node
但是,我无法将我的元掩体连接到节点,也无法通过WS连接。我收到了两个都发生的“错误”,我还试图通过Python中的脚本连接,并且我无法使用两个协议连接到节点。我认为问题是我的服务器不允许其他人连接到节点。如果我运行'geth geth naction http://127.0.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.shancing”,我会得到“ false”,这应该可以,因为节点已经同步了。
这是我来自Geth的日志:
跟进stackoverflow上的某些答案,我也尝试使用以下参数运行以下参数。无成功:geth-config ./config.toml--datadir ./node-cache 18000 -rpc.Allow-noctected-txs -txlookuplimit 0 -http-http-http-http.http.addr” “ -http.corsdomain” \*“ -http.port” 8545“
I have set up a BSC full node on the mainnet on a hetzner server with Ubuntu 20.04 bsc using the steps provided here: https://www.quicknode.com/guides/infrastructure/how-to-run-a-binance-smart-chain-node
However I can't connect either with my Metamask to the node, nor through the ws. I receive 'an error has occurred' on both of them, I also tried to connect through a script in python and I am unable to connect to the node with both protocols. I assume the issue is that my server is not allowing others to connect to the node. If I run 'geth attach http://127.0.0.1:8545' on the server I get:
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
and if I execute 'eth.syncing' I get 'false', which should be ok as the node is in sync already.
This is my log from geth:
Following up on some of the answers provided on stackoverflow I have also tried to run geth with the following parameters with no success: 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"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了这个问题,如果有人偶然发现相同的情况或接近的情况,您可能想尝试一下。
问题出在 RPC http 请求的 config.toml 上,默认情况下,我在 config.toml 文件中具有以下字段 HTTPHost = "localhost" 和 HTTPVirtualHosts = ["localhost"],我已将 localhost 替换为服务器的外部IP,并且运行完美。您也可以将其替换为 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=*
参数使我也可以使用以下方式连接到节点网络套接字协议。I have found the issue if anyone stumbles upon the same situation or close to it you might wanna try it.
The issue was on my config.toml for the RPC http requests, I had by default the following fields HTTPHost = "localhost" and HTTPVirtualHosts = ["localhost"] in the config.toml file, I have replaced the localhost with my server's external IP, and it worked flawlessly. You can also replace it with 0.0.0.0.
Then I've executed geth with the following arguments:
--config ./config.toml --datadir ./node --ws --ws.origins=* --rpcvhosts=* --cache 18000 --rpc.allow-unprotected-txs --txlookuplimit 0
The
--ws --ws.origins=*
arguments made it also possible to me to connect to the node using the websocket protocol.