Open mikedotexe opened 5 months ago
FASTNEAR has managed to implement JSON RPC Batching, might reach out to @evgenykuzyakov for tips. And as I learn more, hopefully I can help in time.
It's only enabled for read-rpc. I think nearcore can be upgraded to support batch RPC as well, but it requires extra work
In the JSON RPC spec there's an optional way to batch requests.
https://www.jsonrpc.org/specification#batch
For applications that may need to frequently query from multiple places (like pools in DeFi) one could batch these together into a single request.
Since each item in the array is given a unique
id
it would be nice if a failure were indicated in the eventual response with the key of that id.Related: https://stackoverflow.com/questions/70729985/are-batch-json-rpc-requests-not-supported-with-near