From a97e8d1267fafb013aadae6850312c1b07a1ecd8 Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Mon, 22 Nov 2021 13:25:38 +0000 Subject: [PATCH] Get label for chaincode from metadata.json (#509) 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 a4f8f691..f2c8f24b 100755 --- a/test-network-k8s/scripts/chaincode.sh +++ b/test-network-k8s/scripts/chaincode.sh @@ -157,7 +157,9 @@ function set_chaincode_id() { local cc_package=build/chaincode/${CHAINCODE_NAME}.tgz cc_sha256=$(shasum -a 256 ${cc_package} | tr -s ' ' | cut -d ' ' -f 1) - CHAINCODE_ID=${CHAINCODE_LABEL}:${cc_sha256} + label=$( jq -r '.label' chaincode/${CHAINCODE_NAME}/metadata.json) + + CHAINCODE_ID=${label}:${cc_sha256} } # Package and install the chaincode, but do not activate.