Increase 'maxReceivedFrameSize' and 'maxReceivedMessageSize' values for your WebSocket connection
Issue
A WebSocket request to an EVM node errors out with the following message:
Frame size of X bytes exceeds maximum accepted frame size
Cause
The payload from the EVM node exceeds the default message size quota in your client application.
Solution
Increase the quota by setting the values for 'maxReceivedFrameSize' and 'maxReceivedMessageSize' in your client application.
A web3.js example:
var Web3 = require('web3');
var add = 'wss://ws-nd-123-456-789.p2pify.com/3c6e0b8a9c15224a8228b9a98ca1531'
var web3 = new Web3(new Web3.providers.WebsocketProvider(add,
{
clientConfig:{
maxReceivedFrameSize: 10000000000,
maxReceivedMessageSize: 10000000000,
}
}));
If you have any questions, feel free to contact Chainstack support by emailing support@chainstack.com or by submitting this form.
Comments
0 comments
Article is closed for comments.