To remedy this issue, you’ll need to point the JS-SDK to use the HTTP proxy that is exposed in front of the Access APIs for MainNet, TestNet and the Flow Emulator.
The issue you ran into is what happens when the JS-SDK is given an address that corresponds to the GRPC service on each Access API. Since the JS-SDK works in a JavaScript environment, it needs to communicate to an Access API via HTTP, which is why we expose an HTTP proxy in front of each Access API. We’re working on improving our tooling to make this error more intuitive in the future!
To provide context on the difference between access.devnet.nodes.onflow.org:9000 and https://access-testnet.onflow.org. The first one is a grpc binary protocol, while the latter is the https proxy of the grpc binary protocol. The js-sdk needs to work in both the browser and node, so because browsers can’t do proprietary binary protocols we have to talk to the access nodes via the https-proxy.
I haven’t gotten things to work yet but now that I found this thread I’ll give it another try. Updating the js sdk docs with an example would be greatly appreciated!
This might be a dumb question but are the past sporks still accessible? If so, are there https proxys available for those past sporks that we can use for js-sdk calls? When I look at the past sporks page I just see the access node with 9000 port.
Hi there - unfortunately you have to use different urls and possibly versions of the sdk to query past sporks. I believe a community member has created a proxy service to query events of past sporks you can get in touch with.
Here is the discord link. His Discord tag is - NedRyerson#4922
Did you already sort out how to query events from past sporks? I have an http proxy service I have built that lets me query events from any spork (except for a few really old ones that aren’t currently available), I can help you set that up if you’re interested
Oh yes - Alchemy API has super awesome features like that as well! Glad you found a working soltuion. If you have any feedback for the Alchemy API - don’t hesitate to share!