From a4460a9947e9fb5962f2cbbb30e137e6168a8ab4 Mon Sep 17 00:00:00 2001 From: bharadwajambati1 Date: Wed, 21 Aug 2019 09:28:54 -0400 Subject: [PATCH] [FAB-16344] Upgrade scripts for v1.4.3 Signed-off-by: bharadwajambati1 Change-Id: Icd4eb98e7953288cc51577a7952b5680997934c7 --- first-network/byfn.sh | 2 +- first-network/crypto-config.yaml | 1 + first-network/scripts/capabilities.json | 36 +++++++++++++++++++------ first-network/scripts/upgrade_to_v14.sh | 6 ++--- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/first-network/byfn.sh b/first-network/byfn.sh index 587f5c13..e6c3811b 100755 --- a/first-network/byfn.sh +++ b/first-network/byfn.sh @@ -261,7 +261,7 @@ function upgradeNetwork() { docker-compose $COMPOSE_FILES up -d --no-deps $PEER done - docker exec cli scripts/upgrade_to_v14.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE + docker exec cli sh -c "SYS_CHANNEL=$CH_NAME && scripts/upgrade_to_v14.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE" if [ $? -ne 0 ]; then echo "ERROR !!!! Test failed" exit 1 diff --git a/first-network/crypto-config.yaml b/first-network/crypto-config.yaml index a38299b5..e4559042 100644 --- a/first-network/crypto-config.yaml +++ b/first-network/crypto-config.yaml @@ -12,6 +12,7 @@ OrdererOrgs: # --------------------------------------------------------------------------- - Name: Orderer Domain: example.com + EnableNodeOUs: true # --------------------------------------------------------------------------- # "Specs" - See PeerOrgs below for complete description # --------------------------------------------------------------------------- diff --git a/first-network/scripts/capabilities.json b/first-network/scripts/capabilities.json index 38a685b8..47fb7bc8 100644 --- a/first-network/scripts/capabilities.json +++ b/first-network/scripts/capabilities.json @@ -1,9 +1,29 @@ { - "mod_policy": "Admins", - "value": { - "capabilities": { - "V1_4_2": {} - } - }, - "version": "0" -} + "channel": { + "mod_policy": "Admins", + "value": { + "capabilities": { + "V1_4_3": {} + } + }, + "version": "0" + }, + "orderer": { + "mod_policy": "Admins", + "value": { + "capabilities": { + "V1_4_2": {} + } + }, + "version": "0" + }, + "application": { + "mod_policy": "Admins", + "value": { + "capabilities": { + "V1_4_2": {} + } + }, + "version": "0" + } +} \ No newline at end of file diff --git a/first-network/scripts/upgrade_to_v14.sh b/first-network/scripts/upgrade_to_v14.sh index f46217e0..3b0f7b12 100755 --- a/first-network/scripts/upgrade_to_v14.sh +++ b/first-network/scripts/upgrade_to_v14.sh @@ -49,11 +49,11 @@ addCapabilityToChannel() { # Modify the correct section of the config based on capabilities group if [ $GROUP == "orderer" ]; then - jq -s '.[0] * {"channel_group":{"groups":{"Orderer": {"values": {"Capabilities": .[1]}}}}}' config.json ./scripts/capabilities.json > modified_config.json + jq -s '.[0] * {"channel_group":{"groups":{"Orderer": {"values": {"Capabilities": .[1].orderer}}}}}' config.json ./scripts/capabilities.json > modified_config.json elif [ $GROUP == "channel" ]; then - jq -s '.[0] * {"channel_group":{"values": {"Capabilities": .[1]}}}' config.json ./scripts/capabilities.json > modified_config.json + jq -s '.[0] * {"channel_group":{"values": {"Capabilities": .[1].channel}}}' config.json ./scripts/capabilities.json > modified_config.json elif [ $GROUP == "application" ]; then - jq -s '.[0] * {"channel_group":{"groups":{"Application": {"values": {"Capabilities": .[1]}}}}}' config.json ./scripts/capabilities.json > modified_config.json + jq -s '.[0] * {"channel_group":{"groups":{"Application": {"values": {"Capabilities": .[1].application}}}}}' config.json ./scripts/capabilities.json > modified_config.json fi # Create a config updated for this channel based on the differences between config.json and modified_config.json