mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 09:35:10 +00:00
update with review comments
Signed-off-by: Sam Yuan <yy19902439@126.com>
This commit is contained in:
parent
97bab7dc4f
commit
c4ad7d95ca
5 changed files with 29 additions and 3 deletions
|
|
@ -6,6 +6,11 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# import utils
|
# 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=${test_network_home:-${PWD}}
|
||||||
. ${test_network_home}/scripts/envVar.sh
|
. ${test_network_home}/scripts/envVar.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,11 @@
|
||||||
# This is a collection of bash functions used by different scripts
|
# This is a collection of bash functions used by different scripts
|
||||||
|
|
||||||
# imports
|
# 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=${test_network_home:-${PWD}}
|
||||||
. ${test_network_home}/scripts/utils.sh
|
. ${test_network_home}/scripts/utils.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
||||||
# import environment variables
|
# 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=..
|
export test_network_home=..
|
||||||
. ${test_network_home}/scripts/envVar.sh
|
. ${test_network_home}/scripts/envVar.sh
|
||||||
|
|
||||||
|
|
@ -48,7 +53,7 @@ joinChannel() {
|
||||||
|
|
||||||
setAnchorPeer() {
|
setAnchorPeer() {
|
||||||
ORG=$1
|
ORG=$1
|
||||||
scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
|
${test_network_home}/scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
setGlobalsCLI 3
|
setGlobalsCLI 3
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ MAX_RETRY=5
|
||||||
|
|
||||||
|
|
||||||
# imports
|
# 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=..
|
export test_network_home=..
|
||||||
. ${test_network_home}/scripts/configUpdate.sh
|
. ${test_network_home}/scripts/configUpdate.sh
|
||||||
|
|
||||||
|
|
@ -33,7 +38,7 @@ fetchChannelConfig 1 ${CHANNEL_NAME} config.json
|
||||||
|
|
||||||
# Modify the configuration to append the new org
|
# Modify the configuration to append the new org
|
||||||
set -x
|
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
|
{ 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
|
# 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
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,13 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# import utils
|
# 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
|
# NOTE: this must be run in a CLI container since it requires jq and configtxlator
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue