From 9f4f9a7b38b8ed8eccb9cd8f400d68d4f3e244f0 Mon Sep 17 00:00:00 2001 From: Julian Castrence Date: Mon, 7 Dec 2020 14:39:02 -0500 Subject: [PATCH] Remove Short Name Support in Scripts Signed-off-by: Julian Castrence --- ci/scripts/run-test-network-basic.sh | 3 ++- test-network/scriptUtils.sh | 4 ++-- test-network/scripts/deployCC.sh | 28 ---------------------------- 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/ci/scripts/run-test-network-basic.sh b/ci/scripts/run-test-network-basic.sh index e6e38d66..9421c0a9 100755 --- a/ci/scripts/run-test-network-basic.sh +++ b/ci/scripts/run-test-network-basic.sh @@ -3,6 +3,7 @@ set -euo pipefail FABRIC_VERSION=${FABRIC_VERSION:-2.2} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} CHAINCODE_NAME=${CHAINCODE_NAME:-basic} +CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-basic/application-go} function print() { GREEN='\033[0;32m' @@ -15,7 +16,7 @@ function createNetwork() { print "Creating network" ./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}" print "Deploying ${CHAINCODE_NAME} chaincode" - ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" + ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" } function stopNetwork() { diff --git a/test-network/scriptUtils.sh b/test-network/scriptUtils.sh index f948c3ff..3f14cd50 100755 --- a/test-network/scriptUtils.sh +++ b/test-network/scriptUtils.sh @@ -94,11 +94,11 @@ function printHelp() { println println " Used with \033[0;32mnetwork.sh deployCC\033[0m" println " -c - Name of channel to deploy chaincode to" - println " -ccn - Chaincode name. This flag can be used to deploy one of the asset transfer samples to a channel. Sample options: basic (default),ledger, private, sbe, secured" + println " -ccn - Chaincode name." println " -ccl - Programming language of the chaincode to deploy: go (default), java, javascript, typescript" println " -ccv - Chaincode version. 1.0 (default), v2, version3.x, etc" println " -ccs - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc" - println " -ccp - (Optional) File path to the chaincode. When provided, the -ccn flag will be used only for the chaincode name." + println " -ccp - File path to the chaincode." println " -ccep - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2" println " -cccg - (Optional) File path to private data collections configuration file" println " -cci - (Optional) Name of chaincode initialization function. When a function is provided, the execution of init will be requested and the function will be invoked." diff --git a/test-network/scripts/deployCC.sh b/test-network/scripts/deployCC.sh index 03c3dd7d..f40ba95d 100755 --- a/test-network/scripts/deployCC.sh +++ b/test-network/scripts/deployCC.sh @@ -33,34 +33,6 @@ CC_SRC_LANGUAGE=$(echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]) FABRIC_CFG_PATH=$PWD/../config/ -# User has not provided a path, therefore the CC_NAME must -# be the short name of a known chaincode sample -if [ "$CC_SRC_PATH" = "NA" ]; then - infoln "Determining the path to the chaincode" - # first see which chaincode we have. This will be based on the - # short name of the known chaincode sample - if [ "$CC_NAME" = "basic" ]; then - println $'\e[0;32m'asset-transfer-basic$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-basic" - elif [ "$CC_NAME" = "events" ]; then - println $'\e[0;32m'asset-transfer-events$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-events" - elif [ "$CC_NAME" = "secured" ]; then - println $'\e[0;32m'asset-transfer-secured-agreeement$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-secured-agreement" - elif [ "$CC_NAME" = "ledger" ]; then - println $'\e[0;32m'asset-transfer-ledger-agreeement$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-ledger-queries" - elif [ "$CC_NAME" = "private" ]; then - println $'\e[0;32m'asset-transfer-private-data$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-private-data" - elif [ "$CC_NAME" = "sbe" ]; then - println $'\e[0;32m'asset-transfer-sbe$'\e[0m' chaincode - CC_SRC_PATH="../asset-transfer-sbe" - else - fatalln "The chaincode name ${CC_NAME} is not supported by this script. Supported chaincode names are: basic, events, ledger, private, sbe, secured" - fi - # now see what language it is written in if [ "$CC_SRC_LANGUAGE" = "go" ]; then CC_SRC_PATH="$CC_SRC_PATH/chaincode-go/"