@@ -14,11 +14,13 @@ DELAY="$2"
14
14
LANGUAGE=" $3 "
15
15
TIMEOUT=" $4 "
16
16
VERBOSE=" $5 "
17
+ NO_CHAINCODE=" $6 "
17
18
: ${CHANNEL_NAME:= " mychannel" }
18
19
: ${DELAY:= " 3" }
19
20
: ${LANGUAGE:= " golang" }
20
21
: ${TIMEOUT:= " 10" }
21
22
: ${VERBOSE:= " false" }
23
+ : ${NO_CHAINCODE:= " false" }
22
24
LANGUAGE=` echo " $LANGUAGE " | tr [:upper:] [:lower:]`
23
25
COUNTER=1
24
26
MAX_RETRY=10
@@ -82,61 +84,65 @@ updateAnchorPeers 0 1
82
84
echo " Updating anchor peers for org2..."
83
85
updateAnchorPeers 0 2
84
86
85
- # # at first we package the chaincode
86
- packageChaincode 1 0 1
87
+ if [ " ${NO_CHAINCODE} " != " true" ]; then
87
88
88
- # # Install chaincode on peer0.org1 and peer0.org2
89
- echo " Installing chaincode on peer0.org1..."
90
- installChaincode 0 1
91
- echo " Install chaincode on peer0.org2..."
92
- installChaincode 0 2
89
+ # # at first we package the chaincode
90
+ packageChaincode 1 0 1
93
91
94
- # # query whether the chaincode is installed
95
- queryInstalled 0 1
92
+ # # Install chaincode on peer0.org1 and peer0.org2
93
+ echo " Installing chaincode on peer0.org1..."
94
+ installChaincode 0 1
95
+ echo " Install chaincode on peer0.org2..."
96
+ installChaincode 0 2
96
97
97
- # # approve the definition for org1
98
- approveForMyOrg 1 0 1
98
+ # # query whether the chaincode is installed
99
+ queryInstalled 0 1
99
100
100
- # # query the approval status on both orgs, expect org1 to have approved and org2 not to
101
- queryStatus 1 0 1 " \" Org1MSP\" : true" " \" Org2MSP\" : false"
102
- queryStatus 1 0 2 " \" Org1MSP\" : true" " \" Org2MSP\" : false"
101
+ # # approve the definition for org1
102
+ approveForMyOrg 1 0 1
103
103
104
- # # now approve also for org2
105
- approveForMyOrg 1 0 2
104
+ # # query the approval status on both orgs, expect org1 to have approved and org2 not to
105
+ queryStatus 1 0 1 " \" Org1MSP\" : true" " \" Org2MSP\" : false"
106
+ queryStatus 1 0 2 " \" Org1MSP\" : true" " \" Org2MSP\" : false"
106
107
107
- # # query the approval status on both orgs, expect them both to have approved
108
- queryStatus 1 0 1 " \" Org1MSP\" : true" " \" Org2MSP\" : true"
109
- queryStatus 1 0 2 " \" Org1MSP\" : true" " \" Org2MSP\" : true"
108
+ # # now approve also for org2
109
+ approveForMyOrg 1 0 2
110
110
111
- # # now that we know for sure both orgs have approved, commit the definition
112
- commitChaincodeDefinition 1 0 1 0 2
111
+ # # query the approval status on both orgs, expect them both to have approved
112
+ queryStatus 1 0 1 " \" Org1MSP\" : true" " \" Org2MSP\" : true"
113
+ queryStatus 1 0 2 " \" Org1MSP\" : true" " \" Org2MSP\" : true"
113
114
114
- # # query on both orgs to see that the definition committed ok
115
- queryCommitted 1 0 1
116
- queryCommitted 1 0 2
115
+ # # now that we know for sure both orgs have approved, commit the definition
116
+ commitChaincodeDefinition 1 0 1 0 2
117
117
118
- # invoke init
119
- chaincodeInvoke 1 0 1 0 2
118
+ # # query on both orgs to see that the definition committed ok
119
+ queryCommitted 1 0 1
120
+ queryCommitted 1 0 2
120
121
121
- # Query chaincode on peer0.org1
122
- echo " Querying chaincode on peer0.org1..."
123
- chaincodeQuery 0 1 100
122
+ # invoke init
123
+ chaincodeInvoke 1 0 1 0 2
124
124
125
- # Invoke chaincode on peer0.org1 and peer0.org2
126
- echo " Sending invoke transaction on peer0.org1 peer0.org2 ..."
127
- chaincodeInvoke 0 0 1 0 2
125
+ # Query chaincode on peer0.org1
126
+ echo " Querying chaincode on peer0.org1..."
127
+ chaincodeQuery 0 1 100
128
128
129
- # Query chaincode on peer0.org1
130
- echo " Querying chaincode on peer0.org1..."
131
- chaincodeQuery 0 1 90
129
+ # Invoke chaincode on peer0.org1 and peer0.org2
130
+ echo " Sending invoke transaction on peer0.org1 peer0.org2 ..."
131
+ chaincodeInvoke 0 0 1 0 2
132
132
133
- # # Install chaincode on peer1.org2
134
- echo " Installing chaincode on peer1.org2 ..."
135
- installChaincode 1 2
133
+ # Query chaincode on peer0.org1
134
+ echo " Querying chaincode on peer0.org1 ..."
135
+ chaincodeQuery 0 1 90
136
136
137
- # Query on chaincode on peer1.org2, check if the result is 90
138
- echo " Querying chaincode on peer1.org2..."
139
- chaincodeQuery 1 2 90
137
+ # # Install chaincode on peer1.org2
138
+ echo " Installing chaincode on peer1.org2..."
139
+ installChaincode 1 2
140
+
141
+ # Query on chaincode on peer1.org2, check if the result is 90
142
+ echo " Querying chaincode on peer1.org2..."
143
+ chaincodeQuery 1 2 90
144
+
145
+ fi
140
146
141
147
echo
142
148
echo " ========= All GOOD, BYFN execution completed =========== "
0 commit comments