From 842ca1949d5e34b8fee7f8da7182a55c93abc71b Mon Sep 17 00:00:00 2001 From: D Date: Thu, 2 Dec 2021 09:12:01 +0000 Subject: [PATCH] address issue from update orderer node Also add timestamps --- fabric-network/docker-based-syschannel/network.sh | 5 +++++ .../docker-based-syschannel/scripts/createChannel.sh | 4 ---- .../docker-based-syschannel/scripts/setAnchorPeer.sh | 3 ++- .../docker-based-syschannel/scripts/updateChannelConfig.sh | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fabric-network/docker-based-syschannel/network.sh b/fabric-network/docker-based-syschannel/network.sh index fb4e778..b1cfe24 100755 --- a/fabric-network/docker-based-syschannel/network.sh +++ b/fabric-network/docker-based-syschannel/network.sh @@ -18,6 +18,11 @@ export VERBOSE=false . scripts/utils.sh +# Create channel-artifacts here otherwise docker will create the dir as root which then causes other stuff to fail +if [ ! -d "channel-artifacts" ]; then + mkdir channel-artifacts +fi + # Obtain CONTAINER_IDS and remove them # TODO Might want to make this optional - could clear other containers # This function is called when you bring a network down diff --git a/fabric-network/docker-based-syschannel/scripts/createChannel.sh b/fabric-network/docker-based-syschannel/scripts/createChannel.sh index 4c38a13..59d3830 100755 --- a/fabric-network/docker-based-syschannel/scripts/createChannel.sh +++ b/fabric-network/docker-based-syschannel/scripts/createChannel.sh @@ -13,10 +13,6 @@ VERBOSE="$4" : ${MAX_RETRY:="5"} : ${VERBOSE:="false"} -if [ ! -d "channel-artifacts" ]; then - mkdir channel-artifacts -fi - createChannelTx() { set -x configtxgen -profile ApplicationGenesis -outputCreateChannelTx ./channel-artifacts/${CHANNEL_NAME}.tx -channelID $CHANNEL_NAME diff --git a/fabric-network/docker-based-syschannel/scripts/setAnchorPeer.sh b/fabric-network/docker-based-syschannel/scripts/setAnchorPeer.sh index bf4ba9a..7f66b29 100755 --- a/fabric-network/docker-based-syschannel/scripts/setAnchorPeer.sh +++ b/fabric-network/docker-based-syschannel/scripts/setAnchorPeer.sh @@ -45,13 +45,14 @@ createAnchorPeerUpdate() { } updateAnchorPeer() { + timestamp set -x peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer1.example.com -c $CHANNEL_NAME -f ${CORE_PEER_LOCALMSPID}anchors.tx --tls --cafile $ORDERER_CA >&log.txt res=$? { set +x; } 2>/dev/null cat log.txt verifyResult $res "Anchor peer update failed" - successln "Anchor peer set for org '$CORE_PEER_LOCALMSPID' on channel '$CHANNEL_NAME'" + successln "$(timestamp) Anchor peer set for org '$CORE_PEER_LOCALMSPID' on channel '$CHANNEL_NAME'" } ORG=$1 diff --git a/fabric-network/docker-based-syschannel/scripts/updateChannelConfig.sh b/fabric-network/docker-based-syschannel/scripts/updateChannelConfig.sh index 73db937..b8d5421 100755 --- a/fabric-network/docker-based-syschannel/scripts/updateChannelConfig.sh +++ b/fabric-network/docker-based-syschannel/scripts/updateChannelConfig.sh @@ -49,8 +49,9 @@ signConfigtxAsPeerOrg 2 org4_update_in_envelope.pb infoln "Submitting transaction from a different peer (peer0.org3) which also signs it" setGlobals 3 +timestamp set -x peer channel update -f org4_update_in_envelope.pb -c ${CHANNEL_NAME} -o localhost:7050 --ordererTLSHostnameOverride orderer1.example.com --tls --cafile "$ORDERER_CA" { set +x; } 2>/dev/null -successln "Config transaction to add org4 to network submitted" \ No newline at end of file +successln "$(timestamp) Config transaction to add org4 to network submitted"