mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 17:45:10 +00:00
Completely Remove Short Name Support (#390)
Signed-off-by: Julian Castrence <juliancastrence@ibm.com> Co-authored-by: Julian Castrence <juliancastrence@ibm.com>
This commit is contained in:
parent
377ccb0b59
commit
27ac653c74
11 changed files with 41 additions and 66 deletions
|
|
@ -29,7 +29,7 @@ Note that we use the `-ca` flag to deploy the network using certificate authorit
|
||||||
|
|
||||||
Run the following command to deploy the auction smart contract. We will override the default endorsement policy to allow any channel member to create an auction without requiring an endorsement from another organization.
|
Run the following command to deploy the auction smart contract. We will override the default endorsement policy to allow any channel member to create an auction without requiring an endorsement from another organization.
|
||||||
```
|
```
|
||||||
./network.sh deployCC -ccn auction -ccp ../auction/chaincode-go/ -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -ccl go
|
./network.sh deployCC -ccn auction -ccp ../auction/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install the application dependencies
|
## Install the application dependencies
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-basic}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-basic}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-basic}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
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}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-javascript}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-javascript}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-events}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-events}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-events}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca
|
./network.sh up createChannel -ca
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
||||||
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-ledger}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-ledger}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-ledger-queries}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
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}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-private}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-private}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-private-data}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
||||||
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-typescript}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-typescript}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-sbe}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-sbe}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-sbe}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}"
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
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}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
||||||
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
||||||
CHAINCODE_NAME=${CHAINCODE_NAME:-secured}
|
CHAINCODE_NAME=${CHAINCODE_NAME:-secured}
|
||||||
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-secured-agreement}
|
||||||
|
|
||||||
function print() {
|
function print() {
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
|
|
@ -15,7 +16,7 @@ function createNetwork() {
|
||||||
print "Creating network"
|
print "Creating network"
|
||||||
./network.sh up createChannel -ca
|
./network.sh up createChannel -ca
|
||||||
print "Deploying ${CHAINCODE_NAME} chaincode"
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
||||||
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopNetwork() {
|
function stopNetwork() {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ pushd ../test-network
|
||||||
|
|
||||||
echo "Bring up test network"
|
echo "Bring up test network"
|
||||||
./network.sh up createChannel -ca
|
./network.sh up createChannel -ca
|
||||||
./network.sh deployCC -ccn bigdatacc -ccp ../high-throughput/chaincode-go/ -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -ccl go -cci Init
|
./network.sh deployCC -ccn bigdatacc -ccp ../high-throughput/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cci Init
|
||||||
popd
|
popd
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -361,8 +361,8 @@ MAX_RETRY=5
|
||||||
CLI_DELAY=3
|
CLI_DELAY=3
|
||||||
# channel name defaults to "mychannel"
|
# channel name defaults to "mychannel"
|
||||||
CHANNEL_NAME="mychannel"
|
CHANNEL_NAME="mychannel"
|
||||||
# chaincode name defaults to "basic"
|
# chaincode name defaults to "NA"
|
||||||
CC_NAME="basic"
|
CC_NAME="NA"
|
||||||
# chaincode path defaults to "NA"
|
# chaincode path defaults to "NA"
|
||||||
CC_SRC_PATH="NA"
|
CC_SRC_PATH="NA"
|
||||||
# endorsement policy defaults to "NA". This would allow chaincodes to use the majority default policy.
|
# endorsement policy defaults to "NA". This would allow chaincodes to use the majority default policy.
|
||||||
|
|
@ -382,8 +382,8 @@ COMPOSE_FILE_COUCH_ORG3=addOrg3/docker/docker-compose-couch-org3.yaml
|
||||||
# use this as the default docker-compose yaml definition for org3
|
# use this as the default docker-compose yaml definition for org3
|
||||||
COMPOSE_FILE_ORG3=addOrg3/docker/docker-compose-org3.yaml
|
COMPOSE_FILE_ORG3=addOrg3/docker/docker-compose-org3.yaml
|
||||||
#
|
#
|
||||||
# use go as the default language for chaincode
|
# chaincode language defaults to "NA"
|
||||||
CC_SRC_LANGUAGE="go"
|
CC_SRC_LANGUAGE="NA"
|
||||||
# Chaincode version
|
# Chaincode version
|
||||||
CC_VERSION="1.0"
|
CC_VERSION="1.0"
|
||||||
# Chaincode definition sequence
|
# Chaincode definition sequence
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,11 @@ function printHelp() {
|
||||||
println
|
println
|
||||||
println " Flags:"
|
println " Flags:"
|
||||||
println " -c <channel name> - Name of channel to deploy chaincode to"
|
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 chaincode to deploy: go (default), java, javascript, typescript"
|
println " -ccl <language> - Programming language of chaincode to deploy: go, java, javascript, typescript"
|
||||||
println " -ccv <version> - Chaincode version. 1.0 (default), v2, version3.x, etc"
|
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 " -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 " -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 " -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."
|
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."
|
||||||
|
|
@ -94,11 +94,11 @@ function printHelp() {
|
||||||
println
|
println
|
||||||
println " Used with \033[0;32mnetwork.sh deployCC\033[0m"
|
println " Used with \033[0;32mnetwork.sh deployCC\033[0m"
|
||||||
println " -c <channel name> - Name of channel to deploy chaincode to"
|
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 " -ccl <language> - Programming language of the chaincode to deploy: go, java, javascript, typescript"
|
||||||
println " -ccv <version> - Chaincode version. 1.0 (default), v2, version3.x, etc"
|
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 " -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 " -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 " -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."
|
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."
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
source scriptUtils.sh
|
source scriptUtils.sh
|
||||||
|
|
||||||
CHANNEL_NAME=${1:-"mychannel"}
|
CHANNEL_NAME=${1:-"mychannel"}
|
||||||
CC_NAME=${2:-"basic"}
|
CC_NAME=${2}
|
||||||
CC_SRC_PATH=${3:-"NA"}
|
CC_SRC_PATH=${3}
|
||||||
CC_SRC_LANGUAGE=${4:-"go"}
|
CC_SRC_LANGUAGE=${4}
|
||||||
CC_VERSION=${5:-"1.0"}
|
CC_VERSION=${5:-"1.0"}
|
||||||
CC_SEQUENCE=${6:-"1"}
|
CC_SEQUENCE=${6:-"1"}
|
||||||
CC_INIT_FCN=${7:-"NA"}
|
CC_INIT_FCN=${7:-"NA"}
|
||||||
|
|
@ -29,58 +29,27 @@ println "- DELAY: ${C_GREEN}${DELAY}${C_RESET}"
|
||||||
println "- MAX_RETRY: ${C_GREEN}${MAX_RETRY}${C_RESET}"
|
println "- MAX_RETRY: ${C_GREEN}${MAX_RETRY}${C_RESET}"
|
||||||
println "- VERBOSE: ${C_GREEN}${VERBOSE}${C_RESET}"
|
println "- VERBOSE: ${C_GREEN}${VERBOSE}${C_RESET}"
|
||||||
|
|
||||||
CC_SRC_LANGUAGE=$(echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:])
|
|
||||||
|
|
||||||
FABRIC_CFG_PATH=$PWD/../config/
|
FABRIC_CFG_PATH=$PWD/../config/
|
||||||
|
|
||||||
# User has not provided a path, therefore the CC_NAME must
|
#User has not provided a name
|
||||||
# be the short name of a known chaincode sample
|
if [ -z "$CC_NAME" ] || [ "$CC_NAME" = "NA" ]; then
|
||||||
if [ "$CC_SRC_PATH" = "NA" ]; then
|
fatalln "No chaincode name was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"
|
||||||
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
|
# User has not provided a path
|
||||||
if [ "$CC_SRC_LANGUAGE" = "go" ]; then
|
elif [ -z "$CC_SRC_PATH" ] || [ "$CC_SRC_PATH" = "NA" ]; then
|
||||||
CC_SRC_PATH="$CC_SRC_PATH/chaincode-go/"
|
fatalln "No chaincode path was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"
|
||||||
elif [ "$CC_SRC_LANGUAGE" = "java" ]; then
|
|
||||||
CC_SRC_PATH="$CC_SRC_PATH/chaincode-java/"
|
|
||||||
elif [ "$CC_SRC_LANGUAGE" = "javascript" ]; then
|
|
||||||
CC_SRC_PATH="$CC_SRC_PATH/chaincode-javascript/"
|
|
||||||
elif [ "$CC_SRC_LANGUAGE" = "typescript" ]; then
|
|
||||||
CC_SRC_PATH="$CC_SRC_PATH/chaincode-typescript/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check that the language is available for the sample chaincode
|
# User has not provided a language
|
||||||
if [ ! -d "$CC_SRC_PATH" ]; then
|
elif [ -z "$CC_SRC_LANGUAGE" ] || [ "$CC_SRC_LANGUAGE" = "NA" ]; then
|
||||||
fatalln "The smart contract language \"$CC_SRC_LANGUAGE\" is not yet available for the \"$CC_NAME\" sample smart contract"
|
fatalln "No chaincode language was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go"
|
||||||
fi
|
|
||||||
## Make sure that the path the chaincode exists if provided
|
## Make sure that the path to the chaincode exists
|
||||||
elif [ ! -d "$CC_SRC_PATH" ]; then
|
elif [ ! -d "$CC_SRC_PATH" ]; then
|
||||||
fatalln "Path to chaincode does not exist. Please provide different path"
|
fatalln "Path to chaincode does not exist. Please provide different path."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CC_SRC_LANGUAGE=$(echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:])
|
||||||
|
|
||||||
# do some language specific preparation to the chaincode before packaging
|
# do some language specific preparation to the chaincode before packaging
|
||||||
if [ "$CC_SRC_LANGUAGE" = "go" ]; then
|
if [ "$CC_SRC_LANGUAGE" = "go" ]; then
|
||||||
CC_RUNTIME_LANGUAGE=golang
|
CC_RUNTIME_LANGUAGE=golang
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue