Skip to content

Commit e5b898c

Browse files
author
Brett Logan
authored
Revert "first-network/scripts/*: Make Chaincode name configurable (#118)" (#131)
This reverts commit 9ef61e2. Introduced regressions when running without explicitly specifying a chaincode label Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
1 parent 9ef61e2 commit e5b898c

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

first-network/scripts/script.sh

-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ CC_SRC_LANGUAGE="$3"
1515
TIMEOUT="$4"
1616
VERBOSE="$5"
1717
NO_CHAINCODE="$6"
18-
NAME="$7"
1918
: ${CHANNEL_NAME:="mychannel"}
2019
: ${DELAY:="3"}
2120
: ${CC_SRC_LANGUAGE:="go"}
2221
: ${TIMEOUT:="10"}
2322
: ${VERBOSE:="false"}
2423
: ${NO_CHAINCODE:="false"}
25-
: ${NAME:="mycc"}
2624
CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]`
2725
COUNTER=1
2826
MAX_RETRY=20
@@ -45,7 +43,6 @@ fi
4543

4644

4745
echo "Channel name : "$CHANNEL_NAME
48-
echo "Chaincode name : "$NAME
4946

5047
# import utils
5148
. scripts/utils.sh

first-network/scripts/step1org3.sh

-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ DELAY="$2"
1616
CC_SRC_LANGUAGE="$3"
1717
TIMEOUT="$4"
1818
VERBOSE="$5"
19-
NAME="$6"
2019
: ${CHANNEL_NAME:="mychannel"}
2120
: ${DELAY:="3"}
2221
: ${CC_SRC_LANGUAGE:="go"}
2322
: ${TIMEOUT:="10"}
2423
: ${VERBOSE:="false"}
25-
: ${NAME:="mycc"}
2624
CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]`
2725
COUNTER=1
2826
MAX_RETRY=5

first-network/scripts/step2org3.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ DELAY="$2"
1919
CC_SRC_LANGUAGE="$3"
2020
TIMEOUT="$4"
2121
VERBOSE="$5"
22-
NAME="$6"
2322
: ${CHANNEL_NAME:="mychannel"}
2423
: ${DELAY:="3"}
2524
: ${CC_SRC_LANGUAGE:="go"}
2625
: ${TIMEOUT:="10"}
2726
: ${VERBOSE:="false"}
28-
: ${NAME:="mycc"}
2927
CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]`
3028
COUNTER=1
3129
MAX_RETRY=5

first-network/scripts/testorg3.sh

-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ DELAY="$2"
2525
CC_SRC_LANGUAGE="$3"
2626
TIMEOUT="$4"
2727
VERBOSE="$5"
28-
NAME="$6"
2928
: ${CHANNEL_NAME:="mychannel"}
3029
: ${TIMEOUT:="10"}
3130
: ${CC_SRC_LANGUAGE:="go"}
3231
: ${VERBOSE:="false"}
33-
: ${NAME:="mycc"}
3432
CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]`
3533
COUNTER=1
3634
MAX_RETRY=5

first-network/scripts/upgrade_to_v14.sh

-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ DELAY="$2"
1414
CC_SRC_LANGUAGE="$3"
1515
TIMEOUT="$4"
1616
VERBOSE="$5"
17-
NAME="$6"
1817
: ${CHANNEL_NAME:="mychannel"}
1918
: ${DELAY:="5"}
2019
: ${CC_SRC_LANGUAGE:="go"}
2120
: ${TIMEOUT:="10"}
2221
: ${VERBOSE:="false"}
23-
: ${NAME:="mycc"}
2422
CC_SRC_LANGUAGE=$(echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:])
2523
COUNTER=1
2624
MAX_RETRY=5

first-network/scripts/utils.sh

+11-12
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ packageChaincode() {
120120
ORG=$3
121121
setGlobals $PEER $ORG
122122
set -x
123-
peer lifecycle chaincode package $NAME.tar.gz --path ${CC_SRC_PATH} --lang ${CC_RUNTIME_LANGUAGE} --label $NAME_${VERSION} >&log.txt
123+
peer lifecycle chaincode package mycc.tar.gz --path ${CC_SRC_PATH} --lang ${CC_RUNTIME_LANGUAGE} --label mycc_${VERSION} >&log.txt
124124
res=$?
125125
set +x
126126
cat log.txt
@@ -133,10 +133,9 @@ packageChaincode() {
133133
installChaincode() {
134134
PEER=$1
135135
ORG=$2
136-
NAME=$3
137136
setGlobals $PEER $ORG
138137
set -x
139-
peer lifecycle chaincode install $NAME.tar.gz >&log.txt
138+
peer lifecycle chaincode install mycc.tar.gz >&log.txt
140139
res=$?
141140
set +x
142141
cat log.txt
@@ -171,11 +170,11 @@ approveForMyOrg() {
171170

172171
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
173172
set -x
174-
peer lifecycle chaincode approveformyorg --channelID $CHANNEL_NAME --name $NAME --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} --waitForEvent >&log.txt
173+
peer lifecycle chaincode approveformyorg --channelID $CHANNEL_NAME --name mycc --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} --waitForEvent >&log.txt
175174
set +x
176175
else
177176
set -x
178-
peer lifecycle chaincode approveformyorg --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name $NAME --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} --waitForEvent >&log.txt
177+
peer lifecycle chaincode approveformyorg --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name mycc --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} --waitForEvent >&log.txt
179178
set +x
180179
fi
181180
cat log.txt
@@ -197,12 +196,12 @@ commitChaincodeDefinition() {
197196
# it using the "-o" option
198197
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
199198
set -x
200-
peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID $CHANNEL_NAME --name $NAME $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >&log.txt
199+
peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID $CHANNEL_NAME --name mycc $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >&log.txt
201200
res=$?
202201
set +x
203202
else
204203
set -x
205-
peer lifecycle chaincode commit -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name $NAME $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >&log.txt
204+
peer lifecycle chaincode commit -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name mycc $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >&log.txt
206205
res=$?
207206
set +x
208207
fi
@@ -231,7 +230,7 @@ checkCommitReadiness() {
231230
sleep $DELAY
232231
echo "Attempting to check the commit readiness of the chaincode definition on peer${PEER}.org${ORG} ...$(($(date +%s) - starttime)) secs"
233232
set -x
234-
peer lifecycle chaincode checkcommitreadiness --channelID $CHANNEL_NAME --name $NAME $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --output json --init-required >&log.txt
233+
peer lifecycle chaincode checkcommitreadiness --channelID $CHANNEL_NAME --name mycc $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --output json --init-required >&log.txt
235234
res=$?
236235
set +x
237236
test $res -eq 0 || continue
@@ -272,7 +271,7 @@ queryCommitted() {
272271
sleep $DELAY
273272
echo "Attempting to Query committed status on peer${PEER}.org${ORG} ...$(($(date +%s) - starttime)) secs"
274273
set -x
275-
peer lifecycle chaincode querycommitted --channelID $CHANNEL_NAME --name $NAME >&log.txt
274+
peer lifecycle chaincode querycommitted --channelID $CHANNEL_NAME --name mycc >&log.txt
276275
res=$?
277276
set +x
278277
test $res -eq 0 && VALUE=$(cat log.txt | grep -o '^Version: [0-9], Sequence: [0-9], Endorsement Plugin: escc, Validation Plugin: vscc')
@@ -307,7 +306,7 @@ chaincodeQuery() {
307306
sleep $DELAY
308307
echo "Attempting to Query peer${PEER}.org${ORG} ...$(($(date +%s) - starttime)) secs"
309308
set -x
310-
peer chaincode query -C $CHANNEL_NAME -n $NAME -c '{"Args":["query","a"]}' >&log.txt
309+
peer chaincode query -C $CHANNEL_NAME -n mycc -c '{"Args":["query","a"]}' >&log.txt
311310
res=$?
312311
set +x
313312
test $res -eq 0 && VALUE=$(cat log.txt | awk '/Query Result/ {print $NF}')
@@ -436,12 +435,12 @@ chaincodeInvoke() {
436435
# it using the "-o" option
437436
if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then
438437
set -x
439-
peer chaincode invoke -o orderer.example.com:7050 -C $CHANNEL_NAME -n $NAME $PEER_CONN_PARMS ${INIT_ARG} -c ${CCARGS} >&log.txt
438+
peer chaincode invoke -o orderer.example.com:7050 -C $CHANNEL_NAME -n mycc $PEER_CONN_PARMS ${INIT_ARG} -c ${CCARGS} >&log.txt
440439
res=$?
441440
set +x
442441
else
443442
set -x
444-
peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n $NAME $PEER_CONN_PARMS ${INIT_ARG} -c ${CCARGS} >&log.txt
443+
peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n mycc $PEER_CONN_PARMS ${INIT_ARG} -c ${CCARGS} >&log.txt
445444
res=$?
446445
set +x
447446
fi

0 commit comments

Comments
 (0)