Skip to content

Commit

Permalink
add support GetMultipleKeys
Browse files Browse the repository at this point in the history
Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
  • Loading branch information
pfi79 committed Feb 6, 2025
1 parent 3eab454 commit 8864af8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions peer/chaincode.proto
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ message ChaincodeData {
message ChaincodeAdditionalParams {
bool use_write_batch = 1; // an indication that the peer can handle state write batches
uint32 max_size_write_batch = 2; // maximum size of batches with write state
bool use_get_multiple_keys = 3; // an indication that the peer can handle get multiple keys
uint32 max_size_get_multiple_keys = 4; // maximum size of batches with get multiple keys
}
15 changes: 15 additions & 0 deletions peer/chaincode_shim.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ message ChaincodeMessage {
GET_PRIVATE_DATA_HASH = 22;
PURGE_PRIVATE_DATA = 23;
WRITE_BATCH_STATE = 24;
GET_STATE_MULTIPLE = 25;
}

Type type = 1;
Expand Down Expand Up @@ -73,6 +74,20 @@ message GetStateMetadata {
string collection = 2;
}

// GetStateMultiple is the payload of the ChaincodeMessage.
// It contains the keys to be retrieved from the ledger.
// If a collection is specified, the keys will be retrieved
// from the collection (i.e., the private state).
message GetStateMultiple {
repeated string keys = 1;
string collection = 2;
}

// GetStateMultipleResult is result of executing the GetStateMiltiple request
message GetStateMultipleResult {
repeated bytes values = 1;
}

// PutState is the payload of a ChaincodeMessage. It contains a key and value
// which needs to be written to the transaction's write set. If the collection is
// specified, the key and value would be written to the transaction's private
Expand Down

0 comments on commit 8864af8

Please sign in to comment.