INFURA / go-ethlibs

Ethereum libraries in Go for interacting with Ethereum nodes
MIT License
161 stars 34 forks source link

Cannot specify JSONRPC request Id #7

Closed ryanschneider closed 4 years ago

ryanschneider commented 5 years ago

I can see some scenarios where the caller wants to provide an explicit JSONRPC request ID, but we currently don't expose that.

One solution would be in the GetBlockByNumber, etc. methods in the websocket.Connection interface took options as the last argument(s) (as varargs), and we provided a way to specify the request ID in those options. I can't think of any other options we'd want to implement right now, but could see us exposing options to configure the underlaying http or websocket requests (e.g. http headers or timeouts).