Skip to content

Commit 8864af8

Browse files
committed
add support GetMultipleKeys
Signed-off-by: Fedor Partanskiy <[email protected]>
1 parent 3eab454 commit 8864af8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

peer/chaincode.proto

+2
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,6 @@ message ChaincodeData {
131131
message ChaincodeAdditionalParams {
132132
bool use_write_batch = 1; // an indication that the peer can handle state write batches
133133
uint32 max_size_write_batch = 2; // maximum size of batches with write state
134+
bool use_get_multiple_keys = 3; // an indication that the peer can handle get multiple keys
135+
uint32 max_size_get_multiple_keys = 4; // maximum size of batches with get multiple keys
134136
}

peer/chaincode_shim.proto

+15
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ message ChaincodeMessage {
3939
GET_PRIVATE_DATA_HASH = 22;
4040
PURGE_PRIVATE_DATA = 23;
4141
WRITE_BATCH_STATE = 24;
42+
GET_STATE_MULTIPLE = 25;
4243
}
4344

4445
Type type = 1;
@@ -73,6 +74,20 @@ message GetStateMetadata {
7374
string collection = 2;
7475
}
7576

77+
// GetStateMultiple is the payload of the ChaincodeMessage.
78+
// It contains the keys to be retrieved from the ledger.
79+
// If a collection is specified, the keys will be retrieved
80+
// from the collection (i.e., the private state).
81+
message GetStateMultiple {
82+
repeated string keys = 1;
83+
string collection = 2;
84+
}
85+
86+
// GetStateMultipleResult is result of executing the GetStateMiltiple request
87+
message GetStateMultipleResult {
88+
repeated bytes values = 1;
89+
}
90+
7691
// PutState is the payload of a ChaincodeMessage. It contains a key and value
7792
// which needs to be written to the transaction's write set. If the collection is
7893
// specified, the key and value would be written to the transaction's private

0 commit comments

Comments
 (0)