Open msteiner96 opened 2 years ago
First step is here: https://github.com/cosmos/cosmjs/issues/1250
@webmaster128 Hey, I am looking for this same functionality as well. I'm not sure that I follow how #1250 allows for querying with a block height? Or is there still some implementation needed for us to be able to do any query with a block height?
Appreciate any help that you can provide!
Turns out the gRPC interface does not support height parameters directly. However, they can be passed as metadata. See https://docs.cosmos.network/v0.47/run-node/interact-node#query-for-historical-state-using-grpcurl and https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md.
In https://github.com/cosmos/cosmjs/pull/1378 you see a proof of concept how this can be added to our client to preserve and send it as part of the tendermint RPC request.
I dod not test that in a live system yet. If someone wants to explore this forther, have a look at #1378.
I suggest that we add another parameter to ALL querys, using which you can execute queries not automatically to the current blockheight but to a lower blockheight.
This needs an archive node, since most nodes only have 100 heights saved. Anyways, we can catch that error and it might be helpful.