Get label for chaincode from metadata.json

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This commit is contained in:
Matthew B White 2021-10-22 11:38:37 +01:00
parent 5355fb1b39
commit 0ea5e7762b

View file

@ -139,7 +139,9 @@ function invoke_chaincode() {
function set_chaincode_id() {
local cc_sha256=$(shasum -a 256 build/chaincode/${CHAINCODE_NAME}.tgz | tr -s ' ' | cut -d ' ' -f 1)
CHAINCODE_ID=${CHAINCODE_LABEL}:${cc_sha256}
local label=$( jq -r '.label' chaincode/${CHAINCODE_NAME}/metadata.json)
CHAINCODE_ID=${label}:${cc_sha256}
}
# Package and install the chaincode, but do not activate.