Skip to content

Commit

Permalink
docker container cleanup and script changes
Browse files Browse the repository at this point in the history
Signed-off-by: sapthasurendran <[email protected]>
  • Loading branch information
sapthasurendran committed Dec 10, 2021
1 parent f17df26 commit 0335634
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions fabric-network/bin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ idemixgen
orderer
osnadmin
fabric-ca-server
ledgerutil
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ services:
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ../system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ../channel-artifacts/latest_config.block:/var/hyperledger/orderer/orderer.genesis.block
- ../organizations/ordererOrganizations/example.com/orderers/orderer6.example.com/msp:/var/hyperledger/orderer/msp
- ../organizations/ordererOrganizations/example.com/orderers/orderer6.example.com/tls/:/var/hyperledger/orderer/tls

ports:
- 7056:7056
- 17056:17056
Expand Down
16 changes: 15 additions & 1 deletion fabric-network/docker-based-syschannel/scripts/addNewOrderer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fetchChannelConfig() {
setOrderer $ORG
export FABRIC_CFG_PATH=$PWD/../config/

echo '--------------------' $ORDERER

infoln "$(timestamp) Fetching the most recent configuration block for the channel ${CHANNEL}"

set -x
Expand Down Expand Up @@ -161,7 +161,17 @@ submitConfigUpdateTransaction(){
{ set +x; } 2>/dev/null
infoln " $(timestamp) Submit config update process done"
}
fetchConfigBlock(){

infoln "Fetch latest block from channel ${2}"
ORG=$1
CHANNEL=$2
setOrderer $ORG
peer channel fetch config channel-artifacts/latest_config.block -o localhost:7050 --ordererTLSHostnameOverride orderer1.example.com -c ${CHANNEL} --tls --cafile $ORDERER
docker cp cli:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/latest_config.block ./channel-artifacts/latest_config.block


}
# generate crypto for new orderer
generateOrdererCrypto

Expand Down Expand Up @@ -189,6 +199,10 @@ submitConfigUpdateTransaction 1 'system-channel' 'neworderer_endpoint_config_upd



# fetch latest block and move to channel artifacts
fetchConfigBlock 1 'system-channel'


# start new orderer container
startNewOrderer

Expand Down

0 comments on commit 0335634

Please sign in to comment.