From 8864af8c792ca5e33fa7d200d0e56d000fcd6319 Mon Sep 17 00:00:00 2001 From: Fedor Partanskiy Date: Wed, 22 Jan 2025 16:47:31 +0300 Subject: [PATCH] add support GetMultipleKeys Signed-off-by: Fedor Partanskiy --- peer/chaincode.proto | 2 ++ peer/chaincode_shim.proto | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/peer/chaincode.proto b/peer/chaincode.proto index 2413fc7..96d9e4a 100644 --- a/peer/chaincode.proto +++ b/peer/chaincode.proto @@ -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 } diff --git a/peer/chaincode_shim.proto b/peer/chaincode_shim.proto index 4b9b424..fb350d6 100644 --- a/peer/chaincode_shim.proto +++ b/peer/chaincode_shim.proto @@ -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; @@ -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