Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support GetMultipleKeys #248

Merged
merged 1 commit into from
Feb 6, 2025
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
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