For the connection to the our server we are using @concordium/node-sdk package with the latest version 9.5.3
Since the GRPC V1 was deprecated we needed to switch from using the JsonRPCClient to use the ConcordiumGRPCClient from common-sdk that is inside the package.
are old code was
const {
HttpProvider,
JsonRpcClient,
...,
} = require('@concordium/node-sdk');
constructor() {
this.client = new ConcordiumGRPCClient(new HttpProvider(concordiumJSONNode + ':' + concordiumJSONPort));
....
}
but when we chaged to use the ConcordiumGRPCClient we are getting an error
const {
ConcordiumGRPCClient,
...,
} = require('@concordium/node-sdk');
const { GrpcTransport } = require('@protobuf-ts/grpc-transport');
const grpc = require('@grpc/grpc-js');
constructor() {
const transport = new GrpcTransport({
host: `${concordiumJSONPort}:${concordiumJSONPort}`,
channelCredentials: grpc.credentials.createSsl(),
http2Options: {
keepaliveTimeoutMs: 10000,
keepalivePermitWithoutCalls: 1,
}
});
this.client = new ConcordiumGRPCClient(transport);
....
}
and we are getting this error on a health check
const check = await client.healthCheck();
console.log(check);
{
isHealthy: false,
message: 'Received RST_STREAM with code 2 triggered by internal client error: Protocol error'
}
any ideas what am i missing?
thank you in advance