From 0ea5e7762beff28ed19e4369a82e080d3b1d7e7b Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Fri, 22 Oct 2021 11:38:37 +0100 Subject: [PATCH] Get label for chaincode from metadata.json Signed-off-by: Matthew B White --- test-network-k8s/scripts/chaincode.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-network-k8s/scripts/chaincode.sh b/test-network-k8s/scripts/chaincode.sh index c0fec221..54f63312 100755 --- a/test-network-k8s/scripts/chaincode.sh +++ b/test-network-k8s/scripts/chaincode.sh @@ -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.