Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Yuan <yy19902439@126.com>
  • Loading branch information
SamYuan1990 committed Mar 30, 2024
1 parent 70947d3 commit d3e9d2f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test-network/addOrg3/addOrg3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function addOrg3 () {
# Create the configuration transaction needed to add
# Org3 to the network
infoln "Generating and submitting config tx to add Org3"
cp ${PWD}/../../config/core.yaml ${PWD}
export FABRIC_CFG_PATH=${PWD}/../../config/
. ../scripts/org3-scripts/updateChannelConfig.sh $CHANNEL_NAME $CLI_DELAY $CLI_TIMEOUT $VERBOSE
if [ $? -ne 0 ]; then
fatalln "ERROR !!!! Unable to create config tx"
Expand Down
3 changes: 2 additions & 1 deletion test-network/scripts/configUpdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#

# import utils
script_home=${script_home:-scripts}
project_home=${project_home:-${PWD}}
script_home=${project_home}/scripts
. ${script_home}/envVar.sh

# fetchChannelConfig <org> <channel_id> <output_json>
Expand Down
17 changes: 9 additions & 8 deletions test-network/scripts/envVar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
# This is a collection of bash functions used by different scripts

# imports
script_home=${script_home:-scripts}
project_home=${project_home:-${PWD}}
script_home=${project_home}/scripts
. ${script_home}/utils.sh

export CORE_PEER_TLS_ENABLED=true
export ORDERER_CA=${PWD}/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
export PEER0_ORG1_CA=${PWD}/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
export PEER0_ORG2_CA=${PWD}/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem
export PEER0_ORG3_CA=${PWD}/organizations/peerOrganizations/org3.example.com/tlsca/tlsca.org3.example.com-cert.pem
export ORDERER_CA=${project_home}/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
export PEER0_ORG1_CA=${project_home}/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
export PEER0_ORG2_CA=${project_home}/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem
export PEER0_ORG3_CA=${project_home}/organizations/peerOrganizations/org3.example.com/tlsca/tlsca.org3.example.com-cert.pem

# Set environment variables for the peer org
setGlobals() {
Expand All @@ -29,17 +30,17 @@ setGlobals() {
if [ $USING_ORG -eq 1 ]; then
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG1_CA
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_MSPCONFIGPATH=${project_home}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051
elif [ $USING_ORG -eq 2 ]; then
export CORE_PEER_LOCALMSPID="Org2MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
export CORE_PEER_MSPCONFIGPATH=${project_home}/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
export CORE_PEER_ADDRESS=localhost:9051
elif [ $USING_ORG -eq 3 ]; then
export CORE_PEER_LOCALMSPID="Org3MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG3_CA
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
export CORE_PEER_MSPCONFIGPATH=${project_home}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
export CORE_PEER_ADDRESS=localhost:11051
else
errorln "ORG Unknown"
Expand Down
4 changes: 2 additions & 2 deletions test-network/scripts/org3-scripts/joinChannel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ COUNTER=1
MAX_RETRY=5

# import environment variables
export script_home=../scripts
. ${script_home}/envVar.sh
export project_home=..
. ${project_home}/scripts/envVar.sh

# joinChannel ORG
joinChannel() {
Expand Down
4 changes: 2 additions & 2 deletions test-network/scripts/org3-scripts/updateChannelConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ MAX_RETRY=5


# imports
export script_home=../scripts
. ${script_home}/configUpdate.sh
export project_home=..
. ${project_home}/scripts/configUpdate.sh

infoln "Creating config transaction to add org3 to network"

Expand Down

0 comments on commit d3e9d2f

Please sign in to comment.