Hello,
I’ve had contact with support but they pointed me to this tech. forum, so here goes my question:
I’ve been using the Moralis Speedy Nodes websocket connections for one of my projects. It’s been ok, but I’m experiencing frequent disconnects. I wouldn’t mind paying for a more stable connection, but I’m wondering if the provided Pro Plan node is actually different or will be suffering from the same problems?
To be clear: I know the Pro plan allows more messages to be sent; but that’s not what i care about. I care about a reliable connection to the node.
I’m connecting from nodejs using the web3 client. This is my connection setup:
const provider = new Web3.providers.WebsocketProvider('wss://speedy-nodes-nyc.moralis.io/xxx/bsc/mainnet/ws', {
timeout: 30000, // ms
clientConfig: {
maxReceivedFrameSize: 100000000,
maxReceivedMessageSize: 100000000,
keepalive: true,
keepaliveInterval: 15000 // ms
},
reconnect: {
auto: true,
delay: 15000, // ms
maxAttempts: 3,
onTimeout: false
}
});
I keep getting these:
"message": "CONNECTION ERROR: The connection got closed with the close code '4040' and the following reason string 'Draining connection'"
I’ve tried both with and without reconnects, but both fail and require me te setup the connection again.