mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 03:25:09 +00:00
ORG4 scripts
This commit is contained in:
parent
40cc5e29f6
commit
81a3be3ca4
2 changed files with 15 additions and 14 deletions
|
|
@ -49,7 +49,8 @@ setAnchorPeer() {
|
||||||
scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
|
scripts/setAnchorPeer.sh $ORG $CHANNEL_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
setGlobalsCLI 3
|
|
||||||
|
setGlobalsCLI 4
|
||||||
BLOCKFILE="${CHANNEL_NAME}.block"
|
BLOCKFILE="${CHANNEL_NAME}.block"
|
||||||
|
|
||||||
echo "Fetching channel config block from orderer..."
|
echo "Fetching channel config block from orderer..."
|
||||||
|
|
@ -60,11 +61,11 @@ res=$?
|
||||||
cat log.txt
|
cat log.txt
|
||||||
verifyResult $res "Fetching config block from orderer has failed"
|
verifyResult $res "Fetching config block from orderer has failed"
|
||||||
|
|
||||||
infoln "Joining org3 peer to the channel..."
|
infoln "Joining org4 peer to the channel..."
|
||||||
joinChannel 3
|
joinChannel 4
|
||||||
|
|
||||||
infoln "Setting anchor peer for org3..."
|
infoln "Setting anchor peer for org4..."
|
||||||
setAnchorPeer 3
|
setAnchorPeer 4
|
||||||
|
|
||||||
successln "Channel '$CHANNEL_NAME' joined"
|
successln "Channel '$CHANNEL_NAME' joined"
|
||||||
successln "Org3 peer successfully added to network"
|
successln "Org4 peer successfully added to network"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# This script is designed to be run in the cli container as the
|
# This script is designed to be run in the cli container as the
|
||||||
# first step of the EYFN tutorial. It creates and submits a
|
# first step of the EYFN tutorial. It creates and submits a
|
||||||
# configuration transaction to add org3 to the test network
|
# configuration transaction to add org4 to the test network
|
||||||
#
|
#
|
||||||
|
|
||||||
CHANNEL_NAME="$1"
|
CHANNEL_NAME="$1"
|
||||||
|
|
@ -27,26 +27,26 @@ MAX_RETRY=5
|
||||||
. scripts/configUpdate.sh
|
. scripts/configUpdate.sh
|
||||||
. scripts/utils.sh
|
. scripts/utils.sh
|
||||||
|
|
||||||
infoln "Creating config transaction to add org3 to network"
|
infoln "Creating config transaction to add or4 to network"
|
||||||
|
|
||||||
# Fetch the config for the channel, writing it to config.json
|
# Fetch the config for the channel, writing it to config.json
|
||||||
fetchChannelConfig 1 ${CHANNEL_NAME} config.json
|
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": {"Org4MSP":.[1]}}}}}' config.json ./organizations/peerOrganizations/org4.example.com/org4.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 org4_update_in_envelope.pb
|
||||||
createConfigUpdate ${CHANNEL_NAME} config.json modified_config.json org3_update_in_envelope.pb
|
createConfigUpdate ${CHANNEL_NAME} config.json modified_config.json org4_update_in_envelope.pb
|
||||||
|
|
||||||
infoln "Signing config transaction"
|
infoln "Signing config transaction"
|
||||||
signConfigtxAsPeerOrg 1 org3_update_in_envelope.pb
|
signConfigtxAsPeerOrg 1 org4_update_in_envelope.pb
|
||||||
|
|
||||||
infoln "Submitting transaction from a different peer (peer0.org2) which also signs it"
|
infoln "Submitting transaction from a different peer (peer0.org2) which also signs it"
|
||||||
setGlobals 2
|
setGlobals 2
|
||||||
set -x
|
set -x
|
||||||
peer channel update -f org3_update_in_envelope.pb -c ${CHANNEL_NAME} -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "$ORDERER_CA"
|
peer channel update -f org4_update_in_envelope.pb -c ${CHANNEL_NAME} -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "$ORDERER_CA"
|
||||||
{ set +x; } 2>/dev/null
|
{ set +x; } 2>/dev/null
|
||||||
|
|
||||||
successln "Config transaction to add org3 to network submitted"
|
successln "Config transaction to add org4 to network submitted"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue