[proto] add block query APIs#85
Merged
liran-funaro merged 1 commit intohyperledger:mainfrom Feb 19, 2026
Merged
Conversation
4dcc6e7 to
fb5f2df
Compare
This commits adds the following four gRPC APIs
rpc GetBlockchainInfo(google.protobuf.Empty) returns (common.BlockchainInfo);
rpc GetBlockByNumber(BlockNumber) returns (common.Block);
rpc GetBlockByTxID(TxID) returns (common.Block);
rpc GetTxByID(TxID) returns (common.Envelope);
to be exposed by the sidecar to allow endorser/fsc to query
block or tx envelope from the ledger store.
Signed-off-by: Senthilnathan <cendhu@gmail.com>
fb5f2df to
0501a51
Compare
Comment on lines
+20
to
+22
| rpc GetBlockByNumber(BlockNumber) returns (common.Block); | ||
| rpc GetBlockByTxID(TxID) returns (common.Block); | ||
| rpc GetTxByID(TxID) returns (common.Envelope); |
Contributor
There was a problem hiding this comment.
I suggest modifying these to support batches instead.
message BlockQuery {
repeated uint64 number = 1;
}
message TxIDQuery {
repeated string tx_id = 1;
}
Contributor
Author
There was a problem hiding this comment.
The block store query APIs are not efficient. Hence, I would keep this simple and just reflect existing API signatures in the block store. Then, we will have a limit on these calls. In general, these APIs should be used sparingly and @adecaro confirmed this too. Hence, not providing a repeated fields and then restricting the number of blocks/txs are intentional.
liran-funaro
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
This commits adds the following four gRPC APIs
to be exposed by the sidecar to allow endorser/fsc to query block or tx envelope from the ledger store.