cronos icon indicating copy to clipboard operation
cronos copied to clipboard

Deployed node websocket cannot connect

Open qinxg opened this issue 3 years ago • 8 comments

[v0.6.5]

` [json-rpc]

Enable defines if the gRPC server should be enabled.

enable = true

Address defines the EVM RPC HTTP server address to bind to.

address = "0.0.0.0:8545"

Address defines the EVM WebSocket server address to bind to.

ws-address = "0.0.0.0:8546"

API defines a list of JSON-RPC namespaces that should be enabled

Example: "eth,txpool,personal,net,debug,web3"

api = "eth,txpool,personal,net,debug,web3"`

used ws://127.0.0.1:8546 ws://ip:8546

None of them can be connected Am I missing any configuration?

qinxg avatar Apr 14 '22 17:04 qinxg

ws://127.0.0.1:8546 should work, any error messages? does the http one works?

yihuang avatar Apr 15 '22 08:04 yihuang

Websocket is not allowed HTTP success

qinxg avatar Apr 15 '22 12:04 qinxg

How can I check the recent running log when I start the service??

qinxg avatar Apr 16 '22 01:04 qinxg

How can I check the recent running log when I start the service??

Can you see the log show up at the terminal? you can redirect it to a file.

JayT106 avatar Apr 19 '22 14:04 JayT106

Apr 23 16:03:43 cronosd[75288]: 4:03PM INF indexed block height=2463477 module=txindex server=node Apr 23 16:03:47 cronosd[75288]: 4:03PM INF Starting JSON WebSocket server address=0.0.0.0:8546 Apr 23 16:03:47 cronosd[75288]: 4:03PM INF New websocket connection module=rpc-server protocol=websocket remote=127.0.0.1:33472 server=node Apr 23 16:03:47 cronosd[75288]: 4:03PM INF Starting wsConnection service impl=wsConnection module=rpc-server protocol=websocket remote={"IP":"127.0.0.1","Port":33472,"Zone":""} server=node

qinxg avatar Apr 23 '22 16:04 qinxg

Same error here. Beside the log from @qinxg I'm also getting these error messages:

May 01 23:03:59 ns3157954 cronosd[3264]: 11:03PM ERR Failed to read request err="websocket: close 1006 (abnormal closure): unexpected EOF" module=rpc-server protocol=websocket remote={"IP":"127.0.0.1","Port":54912,"Zone":""} server=node
May 01 23:03:59 ns3157954 cronosd[3264]: 11:03PM INF Stopping wsConnection service impl={"Logger":{}} module=rpc-server protocol=websocket remote={"IP":"127.0.0.1","Port":54912,"Zone":""} server=node
May 01 23:03:59 ns3157954 cronosd[3264]: 11:03PM ERR error while stopping connection error="already stopped" module=rpc-server protocol=websocket server=node

Tested by using $ geth attach ws://$WS_HOST:8546

$ eth version
Geth
Version: 1.10.17-stable
Git Commit: 25c9b49fdb74931137431c24cf28d3c65f9420d2
Git Commit Date: 20220329
Architecture: amd64
Go Version: go1.18
Operating System: linux
GOPATH=
GOROOT=go

jon4hz avatar May 01 '22 23:05 jon4hz

you need https://www.mortysnode.nl/secure-your-strong-node-with-a-reverse-proxy/

wss will be work :)

L2b2n avatar May 02 '22 14:05 L2b2n

you need https://www.mortysnode.nl/secure-your-strong-node-with-a-reverse-proxy/

wss will be work :)

I don't think it's wss problem.

huahuayu avatar May 21 '22 09:05 huahuayu