Would it be possible to add the ability to make a call directly to the node, bypassing the Infura middleware?

I am wondering if it is possible to make a call directly to the node, bypassing Infura’s handling of the call?

While the Infura layer is exactly what is needed 99% of the time, there are a few times where making a direct call to the node may be desirable. For example, this thread discusses the fact that different providers offer different error reasons, which can be disadvantageous. Where this might be the case is an open source package where the user inputs a provider and the package needs to figure out which node type is being used. Some examples where making calls directly to the node and receiving a consistent return would be nice would be:

  • A call to figure out if a node is an archive node
  • (No longer relevant - see Edit #2 below) A call to figure out if a node is Geth or Parity

Parsing the return data of those calls returned from different providers in the open-source package becomes hard to manage if you have to account for every provider’s specific return data as well as the potential changing of that data from the provider over time.

I understand that the right answer is to run my own node :slight_smile:, but I was wondering if this is something that Infura may offer in the future.

Edit #1

For additional context, to figure out if a node is an archive node, I can run this command with the following outputs from different providers:

curl --data '{"method":"eth_getBalance","params":["0xe5Fb31A5CaEE6a96de393bdBF89FBe65fe125Bb3", "0x1"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST <provider>
Infura: {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"project ID does not have access to archive state","data":{"see":"https://infura.io/dashboard"}}

Alchemy: {"jsonrpc": "2.0", "result": "0x3635c9adc5dea00000", "id": 1}

Cloudflare: {"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"missing trie node d67e4d450343046425ae4271474353857ab860dbc0a1dde64b41b5cd3a532bf3 (path )"}}

There are a number of others that provide different results as well.

Edit #2

I now realize that there is a web3_clientVersion endpoint to hit that can help resolve the Geth vs. Parity issue, so that is no longer a concern.

Hey @shane, thanks for this request and the information in the Edit. I made sure the devs are aware of the difficulties faced here. I’ll update you if I found out more on if we’ll add API information like this.

1 Like

Hey @Sean_Infura. Any update here?

Hey @shane , no update really, but glad clientVersion works for one part. For archive node, if you have access to them as part of your plan it should give a non-error response, and an error otherwise.