Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass config object to WebSocketClient #1217

Closed
MattOakley opened this issue Dec 8, 2017 · 5 comments
Closed

Pass config object to WebSocketClient #1217

MattOakley opened this issue Dec 8, 2017 · 5 comments
Assignees
Labels
Enhancement Includes improvements or optimizations

Comments

@MattOakley
Copy link

I'm trying to get a payload of 22meg from the blockchain but I get the exception Frame size of 21980028 bytes exceeds maximum accepted frame size

The maxReceivedFrameSize and maxReceivedMessageSize are set in the websocket client class. If these are increased the code works fine.

Could a config object be passed to Ws when its instantiated in web3-providers-ws?

@JohanTh
Copy link

JohanTh commented Jun 13, 2018

I need this too, I want to do something like:

web3s = new Web3(new Web3.providers.WebsocketProvider({
	httpServer: "ws://localhost:8546",
	maxReceivedFrameSize: 100000000,
	maxReceivedMessageSize: 100000000,
}));

Any solution not requiring me to edit and commit the websockets package?

@MattOakley
Copy link
Author

Not yet, we ended up overriding the WebSocketClient.js file in /node_modules_override, which is not ideal.

@nivida nivida self-assigned this Aug 9, 2018
@nivida nivida added the Enhancement Includes improvements or optimizations label Aug 9, 2018
@theminnow98
Copy link

Is there still no option for this? I cant use the beta with web sockets, every call exceeds max frame size.

@daffl
Copy link
Contributor

daffl commented Sep 18, 2018

It looks like #1631 added a fix for this which should allow doing

web3s = new Web3(new Web3.providers.WebsocketProvider("ws://localhost:8546", {
  clientOptions: {
    maxReceivedFrameSize: 100000000,
    maxReceivedMessageSize: 100000000,
  }
}));

It is available in web3-providers-ws@1.0.0-beta.36 and later.

@MattOakley
Copy link
Author

This is fixed in beta.36 but the setting is clientConfig

web3s = new Web3(new Web3.providers.WebsocketProvider("ws://localhost:8546", {
  clientConfig: {
    maxReceivedFrameSize: 100000000,
    maxReceivedMessageSize: 100000000,
  }
}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

5 participants