update with review comments

Signed-off-by: Sam Yuan <yy19902439@126.com>
This commit is contained in:
Sam Yuan 2024-04-02 20:48:34 +08:00
parent 97bab7dc4f
commit c4ad7d95ca
5 changed files with 29 additions and 3 deletions

View file

@ -6,6 +6,11 @@
#
# import utils
# test network home var targets to test network folder
# the reason we use a var here is considering with org3 specific folder
# when invoking this for org3 as test-network/scripts/org3-scripts
# the value is changed from default as $PWD(test-network)
# to .. as relative path to make the import works
test_network_home=${test_network_home:-${PWD}}
. ${test_network_home}/scripts/envVar.sh

View file

@ -8,6 +8,11 @@
# This is a collection of bash functions used by different scripts
# imports
# test network home var targets to test network folder
# the reason we use a var here is considering with org3 specific folder
# when invoking this for org3 as test-network/scripts/org3-scripts
# the value is changed from default as $PWD(test-network)
# to .. as relative path to make the import works
test_network_home=${test_network_home:-${PWD}}
. ${test_network_home}/scripts/utils.sh

View file

@ -23,6 +23,11 @@ COUNTER=1
MAX_RETRY=5
# import environment variables
# test network home var targets to test network folder
# the reason we use a var here is considering with org3 specific folder
# when invoking this for org3 as test-network/scripts/org3-scripts
# the value is changed from default as $PWD(test-network)
# to .. as relative path to make the import works
export test_network_home=..
. ${test_network_home}/scripts/envVar.sh
@ -48,7 +53,7 @@ joinChannel() {
setAnchorPeer() {
ORG=$1
scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
${test_network_home}/scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
}
setGlobalsCLI 3

View file

@ -23,6 +23,11 @@ MAX_RETRY=5
# imports
# test network home var targets to test network folder
# the reason we use a var here is considering with org3 specific folder
# when invoking this for org3 as test-network/scripts/org3-scripts
# the value is changed from default as $PWD(test-network)
# to .. as relative path to make the import works
export test_network_home=..
. ${test_network_home}/scripts/configUpdate.sh
@ -33,7 +38,7 @@ fetchChannelConfig 1 ${CHANNEL_NAME} config.json
# Modify the configuration to append the new org
set -x
jq -s '.[0] * {"channel_group":{"groups":{"Application":{"groups": {"Org3MSP":.[1]}}}}}' config.json ../organizations/peerOrganizations/org3.example.com/org3.json > modified_config.json
jq -s '.[0] * {"channel_group":{"groups":{"Application":{"groups": {"Org3MSP":.[1]}}}}}' config.json ${test_network_home}/organizations/peerOrganizations/org3.example.com/org3.json > modified_config.json
{ set +x; } 2>/dev/null
# Compute a config update, based on the differences between config.json and modified_config.json, write it as a transaction to org3_update_in_envelope.pb

View file

@ -6,7 +6,13 @@
#
# import utils
. scripts/configUpdate.sh
# test network home var targets to test network folder
# the reason we use a var here is considering with org3 specific folder
# when invoking this for org3 as test-network/scripts/org3-scripts
# the value is changed from default as $PWD(test-network)
# to .. as relative path to make the import works
test_network_home=${test_network_home:-${PWD}}
. ${test_network_home}/scripts/configUpdate.sh
# NOTE: this must be run in a CLI container since it requires jq and configtxlator