Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ proto: FORCE $(PROTOS_SENTINEL)
-I="${PROTOS_DIR}" \
--go_opt=Mmsp/msp_config.proto=github.com/hyperledger/fabric-protos-go-apiv2/msp \
--go-grpc_opt=Mmsp/msp_config.proto=github.com/hyperledger/fabric-protos-go-apiv2/msp \
--go_opt=Mcommon/common.proto=github.com/hyperledger/fabric-protos-go-apiv2/common \
--go_opt=Mcommon/ledger.proto=github.com/hyperledger/fabric-protos-go-apiv2/common \
--go-grpc_opt=Mcommon/common.proto=github.com/hyperledger/fabric-protos-go-apiv2/common \
--go-grpc_opt=Mcommon/ledger.proto=github.com/hyperledger/fabric-protos-go-apiv2/common \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
--go_out=paths=source_relative:. \
Expand Down
193 changes: 193 additions & 0 deletions api/committerpb/block_query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions api/committerpb/block_query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

syntax = "proto3";

option go_package = "github.com/hyperledger/fabric-x-common/api/committerpb";

package committerpb;

import "google/protobuf/empty.proto";
import "common/common.proto";
import "common/ledger.proto";

// BlockQueryService provides read-only access to the block store ledger.
service BlockQueryService {
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);
Comment on lines +20 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest modifying these to support batches instead.

message BlockQuery {
    repeated uint64 number = 1;
}

message TxIDQuery {
    repeated string tx_id = 1;
}

Copy link
Contributor Author

@cendhu cendhu Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

}

message BlockNumber {
uint64 number = 1;
}

message TxID {
string tx_id = 1;
}
Loading