Custom RPC triggers a timeout, but works using Curl
See original GitHub issueDescribe the bug
I am trying to use a network called Neon Devnet. I initialize the provider properly using StaticJsonRpcProvider
with the right provider name and chainId, but no calls or transaction pass. I always get a timeout. We could think that it’s network related, but the same call works on Curl.
Reproduction steps
Initializing the provider:
const provider = new ethers.providers.StaticJsonRpcProvider('https://proxy.devnet.neonlabs.org/solana', { name: 'Neon', chainId: 245022926 });
So far so good. But once I try to shout this:
provider.getBlockNumber()
I get this raised: Uncaught Error: timeout (requestBody="{\"method\":\"eth_blockNumber\",\"params\":[],\"id\":44,\"jsonrpc\":\"2.0\"}", requestMethod="POST", timeout=120000, url="https://proxy.devnet.neonlabs.org/solana", code=TIMEOUT, version=web/5.5.0)
Extracting the parameters from the exception : {"method":"eth_blockNumber","params":[],"id":44,"jsonrpc":"2.0"}
Crafting a Curl command:
curl -X POST --data '{"method":"eth_blockNumber","params":[],"id":44,"jsonrpc":"2.0"}' https://proxy.devnet.neonlabs.org/solana
The Curl command works properly:
{"jsonrpc": "2.0", "id": 44, "result": "0x5d31cef"}
Difficult to know what is going wrong , why do I keep having a timeout using the ethers.js library. Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
I’m not at a computer so I haven’t been able to try curl yet. I’ll look more into this later today too.
It could still be a proxy or server configuration, but I’ll need to look more into it.
thank you !