Remove Short Name Support in Scripts

Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
This commit is contained in:
Julian Castrence 2020-12-07 14:39:02 -05:00
parent 36b5788bad
commit 9f4f9a7b38
3 changed files with 4 additions and 31 deletions

View file

@ -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() {

View file

@ -94,11 +94,11 @@ function printHelp() {
println
println " Used with \033[0;32mnetwork.sh deployCC\033[0m"
println " -c <channel name> - Name of channel to deploy chaincode to"
println " -ccn <name> - 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 <name> - Chaincode name."
println " -ccl <language> - Programming language of the chaincode to deploy: go (default), java, javascript, typescript"
println " -ccv <version> - Chaincode version. 1.0 (default), v2, version3.x, etc"
println " -ccs <sequence> - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc"
println " -ccp <path> - (Optional) File path to the chaincode. When provided, the -ccn flag will be used only for the chaincode name."
println " -ccp <path> - File path to the chaincode."
println " -ccep <policy> - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2"
println " -cccg <collection-config> - (Optional) File path to private data collections configuration file"
println " -cci <fcn name> - (Optional) Name of chaincode initialization function. When a function is provided, the execution of init will be requested and the function will be invoked."

View file

@ -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/"