mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 09:35:10 +00:00
Issue 602 (#641)
* check if running Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> * fix indent Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> better detection in create channel Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> bring network down first case Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> bring network down first case changed count of containers to 4 Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> add echo Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> typo Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com> Co-authored-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
This commit is contained in:
parent
75bdde97cd
commit
50a6dd62ad
1 changed files with 18 additions and 2 deletions
|
|
@ -267,9 +267,25 @@ function networkUp() {
|
||||||
# call the script to create the channel, join the peers of org1 and org2,
|
# call the script to create the channel, join the peers of org1 and org2,
|
||||||
# and then update the anchor peers for each organization
|
# and then update the anchor peers for each organization
|
||||||
function createChannel() {
|
function createChannel() {
|
||||||
# Bring up the network if it is not already up.
|
# Bring up the network if it is not already up.
|
||||||
|
bringUpNetwork="false"
|
||||||
|
|
||||||
if [ ! -d "organizations/peerOrganizations" ]; then
|
if ! $CONTAINER_CLI info > /dev/null 2>&1 ; then
|
||||||
|
fatalln "$CONTAINER_CLI network is required to be running to create a channel"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if all containers are present
|
||||||
|
CONTAINERS=($($CONTAINER_CLI ps | grep hyperledger/ | awk '{print $2}'))
|
||||||
|
len=$(echo ${#CONTAINERS[@]})
|
||||||
|
|
||||||
|
if [[ $len -ge 4 ]] && [[ ! -d "organizations/peerOrganizations" ]]; then
|
||||||
|
echo "Bringing network down to sync certs with containers"
|
||||||
|
networkDown
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ $len -lt 4 ]] || [[ ! -d "organizations/peerOrganizations" ]] && bringUpNetwork="true" || echo "Network Running Already"
|
||||||
|
|
||||||
|
if [ $bringUpNetwork == "true" ]; then
|
||||||
infoln "Bringing up network"
|
infoln "Bringing up network"
|
||||||
networkUp
|
networkUp
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue