@@ -107,16 +107,9 @@ queryInstalled() {
107
107
approveForMyOrg () {
108
108
ORG=$1
109
109
setGlobals $ORG
110
-
111
- if [ -z " $CORE_PEER_TLS_ENABLED " -o " $CORE_PEER_TLS_ENABLED " = " false" ] ; then
112
- set -x
113
- peer lifecycle chaincode approveformyorg -o localhost:7050 --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} --waitForEvent >& log.txt
114
- set +x
115
- else
116
- set -x
117
- peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} >& log.txt
118
- set +x
119
- fi
110
+ set -x
111
+ peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --init-required --package-id ${PACKAGE_ID} --sequence ${VERSION} >& log.txt
112
+ set +x
120
113
cat log.txt
121
114
verifyResult $res " Chaincode definition approved on peer0.org${ORG} on channel '$CHANNEL_NAME ' failed"
122
115
echo " ===================== Chaincode definition approved on peer0.org${ORG} on channel '$CHANNEL_NAME ' ===================== "
@@ -140,7 +133,6 @@ checkCommitReadiness() {
140
133
peer lifecycle chaincode checkcommitreadiness --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --sequence ${VERSION} --output json --init-required >& log.txt
141
134
res=$?
142
135
set +x
143
- # test $res -eq 0 || continue
144
136
let rc=0
145
137
for var in " $@ "
146
138
do
@@ -167,17 +159,10 @@ commitChaincodeDefinition() {
167
159
# while 'peer chaincode' command can get the orderer endpoint from the
168
160
# peer (if join was successful), let's supply it directly as we know
169
161
# it using the "-o" option
170
- if [ -z " $CORE_PEER_TLS_ENABLED " -o " $CORE_PEER_TLS_ENABLED " = " false" ] ; then
171
- set -x
172
- peer lifecycle chaincode commit -o localhost:7050 --channelID $CHANNEL_NAME --name fabcar $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >& log.txt
173
- res=$?
174
- set +x
175
- else
176
- set -x
177
- peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >& log.txt
178
- res=$?
179
- set +x
180
- fi
162
+ set -x
163
+ peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar $PEER_CONN_PARMS --version ${VERSION} --sequence ${VERSION} --init-required >& log.txt
164
+ res=$?
165
+ set +x
181
166
cat log.txt
182
167
verifyResult $res " Chaincode definition commit failed on peer0.org${ORG} on channel '$CHANNEL_NAME ' failed"
183
168
echo " ===================== Chaincode definition committed on channel '$CHANNEL_NAME ' ===================== "
@@ -225,17 +210,10 @@ chaincodeInvokeInit() {
225
210
# while 'peer chaincode' command can get the orderer endpoint from the
226
211
# peer (if join was successful), let's supply it directly as we know
227
212
# it using the "-o" option
228
- if [ -z " $CORE_PEER_TLS_ENABLED " -o " $CORE_PEER_TLS_ENABLED " = " false" ]; then
229
- set -x
230
- peer chaincode invoke -o localhost:7050 -C $CHANNEL_NAME -n fabcar $PEER_CONN_PARMS --isInit -c ' {"function":"initLedger","Args":[]}' >& log.txt
231
- res=$?
232
- set +x
233
- else
234
- set -x
235
- peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n fabcar $PEER_CONN_PARMS --isInit -c ' {"function":"initLedger","Args":[]}' >& log.txt
236
- res=$?
237
- set +x
238
- fi
213
+ set -x
214
+ peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n fabcar $PEER_CONN_PARMS --isInit -c ' {"function":"initLedger","Args":[]}' >& log.txt
215
+ res=$?
216
+ set +x
239
217
cat log.txt
240
218
verifyResult $res " Invoke execution on $PEERS failed "
241
219
echo " ===================== Invoke transaction successful on $PEERS on channel '$CHANNEL_NAME ' ===================== "
0 commit comments