Closed mcwalina closed 1 year ago
@mcwalina It seems you are connecting to node-to-node protocol port which is 6000.
As LocalClientProvider uses node-to-client protocol which is accessible through nodeSocketFile (Unix domain socket), you have to use the following constructor
new LocalClientProvider(nodeSocketFile, protocolMagic)
Alternatively, you can expose nodeSocketFile (Unix Domain Socket) through a relay like 'socket' using tcp host/port, then you can use the other constructor to access remotely.
@satran004 You are right. Exposing socket file by tcp and connecting to it did a job.
socat TCP-LISTEN:3001,fork,reuseaddr, UNIX-CONNECT:/opt/cardano/cnode/sockets/node.socket
LocalClientProvider localClientProvider = new LocalClientProvider("192.168.43.156", 3001, protocolMagic);
2023-01-17T16:40:17.426+01:00 INFO 18828 --- [ntLoopGroup-2-1] c.b.cardano.yaci.core.network.Session : Connection established
2023-01-17T16:40:17.426+01:00 INFO 18828 --- [ntLoopGroup-2-1] c.b.c.yaci.core.network.NodeClient : Connected !!!
2023-01-17T16:40:17.431+01:00 INFO 18828 --- [ntLoopGroup-2-1] c.b.c.y.c.p.handshake.HandshakeAgent : Handshake Ok!!! AcceptVersion(versionNumber=32781, versionData=N2CVersionData{networkMagic=764824073})
Thanks for you help and your contribution.
Hi, I tried connect to my local relay node using: LocalClientProvider localClientProvider = new LocalClientProvider("192.168.43.156", 6000, protocolMagic); localClientProvider.start();
but I getting error:
Logs from relay node:
{"app":[],"at":"2023-01-17T07:33:50.85Z","data":{"address":"192.168.43.114:59592","event":"ErrorPolicySuspendConsumer (Just (ApplicationExceptionTrace (HandshakeError (VersionMismatch [NodeToNodeV_7,NodeToNodeV_8,NodeToNodeV_9] [])))) 200s","kind":"ErrorPolicyTrace"},"env":"1.35.4:ebc7b","host":"rnode","loc":null,"msg":"","ns":["cardano.node.ErrorPolicy"],"pid":"1249","sev":"Notice","thread":"215"}