Skip to content

Commit e1a39e6

Browse files
committed
[FAB-12724] Upgrade from 1.3.x to 1.4.0
Adding support to upgrade from 1.3.x to 1.4.0 using upgrade_to_v14.sh and changes to byfn.sh For this, no v1_4 capabilities need to be enabled other than v1_3 capabilities on channel and application group level Only upgrading the images from v1.3.x to v.1.4.0 for peer, orderer, cli, ccenv Change-Id: I991f96c2deb3c91870ec4654aa8b561f49594248 Signed-off-by: Surya Lanka <suryalnvs@gmail.com>
1 parent 33f064f commit e1a39e6

File tree

5 files changed

+75
-171
lines changed

5 files changed

+75
-171
lines changed

first-network/byfn.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function printHelp() {
4141
echo " - 'down' - clear the network with docker-compose down"
4242
echo " - 'restart' - restart the network"
4343
echo " - 'generate' - generate required certificates and genesis block"
44-
echo " - 'upgrade' - upgrade the network from version 1.2.x to 1.3.x"
44+
echo " - 'upgrade' - upgrade the network from version 1.3.x to 1.4.0"
4545
echo " -c <channel name> - channel name to use (defaults to \"mychannel\")"
4646
echo " -t <timeout> - CLI timeout duration in seconds (defaults to 10)"
4747
echo " -d <delay> - delay duration in seconds (defaults to 3)"
@@ -57,7 +57,7 @@ function printHelp() {
5757
echo
5858
echo " byfn.sh generate -c mychannel"
5959
echo " byfn.sh up -c mychannel -s couchdb"
60-
echo " byfn.sh up -c mychannel -s couchdb -i 1.2.x"
60+
echo " byfn.sh up -c mychannel -s couchdb -i 1.4.0"
6161
echo " byfn.sh up -l node"
6262
echo " byfn.sh down -c mychannel"
6363
echo " byfn.sh upgrade -c mychannel"
@@ -172,14 +172,14 @@ function networkUp() {
172172
fi
173173
}
174174

175-
# Upgrade the network components which are at version 1.2.x to 1.3.x
175+
# Upgrade the network components which are at version 1.3.x to 1.4.x
176176
# Stop the orderer and peers, backup the ledger for orderer and peers, cleanup chaincode containers and images
177177
# and relaunch the orderer and peers with latest tag
178178
function upgradeNetwork() {
179-
if [[ "$IMAGETAG" == *"1.3"* ]] || [[ $IMAGETAG == "latest" ]]; then
179+
if [[ "$IMAGETAG" == *"1.4"* ]] || [[ $IMAGETAG == "latest" ]]; then
180180
docker inspect -f '{{.Config.Volumes}}' orderer.example.com | grep -q '/var/hyperledger/production/orderer'
181181
if [ $? -ne 0 ]; then
182-
echo "ERROR !!!! This network does not appear to be using volumes for its ledgers, did you start from fabric-samples >= v1.2.x?"
182+
echo "ERROR !!!! This network does not appear to start with fabric-samples >= v1.3.x?"
183183
exit 1
184184
fi
185185

@@ -225,13 +225,13 @@ function upgradeNetwork() {
225225
docker-compose $COMPOSE_FILES up -d --no-deps $PEER
226226
done
227227

228-
docker exec cli scripts/upgrade_to_v13.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
228+
docker exec cli scripts/upgrade_to_v14.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
229229
if [ $? -ne 0 ]; then
230230
echo "ERROR !!!! Test failed"
231231
exit 1
232232
fi
233233
else
234-
echo "ERROR !!!! Pass the v1.3.x image tag"
234+
echo "ERROR !!!! Pass the v1.4.x image tag"
235235
fi
236236
}
237237

first-network/configtx.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ Application: &ApplicationDefaults
191191
Type: ImplicitMeta
192192
Rule: "MAJORITY Admins"
193193

194+
Capabilities:
195+
<<: *ApplicationCapabilities
194196
################################################################################
195197
#
196198
# SECTION: Orderer

first-network/scripts/capabilities.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

first-network/scripts/upgrade_to_v13.sh

Lines changed: 0 additions & 155 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
echo
4+
echo " ____ _____ _ ____ _____ "
5+
echo "/ ___| |_ _| / \ | _ \ |_ _|"
6+
echo "\___ \ | | / _ \ | |_) | | | "
7+
echo " ___) | | | / ___ \ | _ < | | "
8+
echo "|____/ |_| /_/ \_\ |_| \_\ |_| "
9+
echo
10+
echo "Upgrade your first network (BYFN) from v1.3.x to v1.4.x end-to-end test"
11+
echo
12+
CHANNEL_NAME="$1"
13+
DELAY="$2"
14+
LANGUAGE="$3"
15+
TIMEOUT="$4"
16+
VERBOSE="$5"
17+
: ${CHANNEL_NAME:="mychannel"}
18+
: ${DELAY:="5"}
19+
: ${LANGUAGE:="golang"}
20+
: ${TIMEOUT:="10"}
21+
: ${VERBOSE:="false"}
22+
LANGUAGE=$(echo "$LANGUAGE" | tr [:upper:] [:lower:])
23+
COUNTER=1
24+
MAX_RETRY=5
25+
26+
CC_SRC_PATH="github.com/chaincode/chaincode_example02/go/"
27+
if [ "$LANGUAGE" = "node" ]; then
28+
CC_SRC_PATH="/opt/gopath/src/github.com/chaincode/chaincode_example02/node/"
29+
fi
30+
31+
echo "Channel name : "$CHANNEL_NAME
32+
33+
# import utils
34+
. scripts/utils.sh
35+
36+
sleep $DELAY
37+
38+
#Query on chaincode on Peer0/Org1
39+
echo "Querying chaincode on org1/peer0..."
40+
chaincodeQuery 0 1 90
41+
42+
sleep $DELAY
43+
44+
#Invoke on chaincode on Peer0/Org1
45+
echo "Sending invoke transaction on org1/peer0..."
46+
chaincodeInvoke 0 1 0 2
47+
48+
sleep $DELAY
49+
50+
#Query on chaincode on Peer0/Org1
51+
echo "Querying chaincode on org1/peer0..."
52+
chaincodeQuery 0 1 80
53+
54+
echo
55+
echo "===================== All GOOD, End-2-End UPGRADE Scenario execution completed ===================== "
56+
echo
57+
58+
echo
59+
echo " _____ _ _ ____ _____ ____ _____ "
60+
echo "| ____| | \ | | | _ \ | ____| |___ \ | ____|"
61+
echo "| _| | \| | | | | | _____ | _| __) | | _| "
62+
echo "| |___ | |\ | | |_| | |_____| | |___ / __/ | |___ "
63+
echo "|_____| |_| \_| |____/ |_____| |_____| |_____|"
64+
echo
65+
66+
exit 0

0 commit comments

Comments
 (0)