From 73267e1f7f9311be57f079e0547d97c70970571b Mon Sep 17 00:00:00 2001 From: NIKHIL E GUPTA Date: Thu, 12 Dec 2019 12:34:59 -0500 Subject: [PATCH] Fix test network bugs for adding org3 Signed-off-by: NIKHIL E GUPTA --- test-network/{add-Org3 => addOrg3}/.env | 0 test-network/{add-org3 => addOrg3}/addOrg3.sh | 35 ++++++++++--------- .../{add-org3 => addOrg3}/configtx.yaml | 0 .../docker/docker-compose-couch-org3.yaml | 0 .../docker/docker-compose-org3.yaml | 0 .../{add-org3 => addOrg3}/org3-crypto.yaml | 0 test-network/network.sh | 4 +-- 7 files changed, 20 insertions(+), 19 deletions(-) rename test-network/{add-Org3 => addOrg3}/.env (100%) rename test-network/{add-org3 => addOrg3}/addOrg3.sh (96%) rename test-network/{add-org3 => addOrg3}/configtx.yaml (100%) rename test-network/{add-org3 => addOrg3}/docker/docker-compose-couch-org3.yaml (100%) rename test-network/{add-org3 => addOrg3}/docker/docker-compose-org3.yaml (100%) rename test-network/{add-org3 => addOrg3}/org3-crypto.yaml (100%) diff --git a/test-network/add-Org3/.env b/test-network/addOrg3/.env similarity index 100% rename from test-network/add-Org3/.env rename to test-network/addOrg3/.env diff --git a/test-network/add-org3/addOrg3.sh b/test-network/addOrg3/addOrg3.sh similarity index 96% rename from test-network/add-org3/addOrg3.sh rename to test-network/addOrg3/addOrg3.sh index 9c95c3c3ff..06014949e8 100755 --- a/test-network/add-org3/addOrg3.sh +++ b/test-network/addOrg3/addOrg3.sh @@ -35,7 +35,7 @@ function printHelp () { echo "Typically, one would first generate the required certificates and " echo "genesis block, then bring up the network. e.g.:" echo - echo " eyfn.sh generate" + echo " addOrg3.sh generate" echo " addOrg3.sh up -c mychannel -s couchdb" echo " addOrg3.sh up -l node" echo " addOrg3.sh down -c mychannel" @@ -175,22 +175,10 @@ IMAGETAG="latest" DATABASE="leveldb" # Parse commandline args -if [ "$1" = "-m" ];then # supports old usage, muscle memory is powerful! - shift -fi -MODE=$1;shift -# Determine whether starting, stopping, restarting or generating for announce -if [ "$MODE" == "up" ]; then - echo ="Add org3 to channel '${CHANNEL_NAME}' with '${CLI_TIMEOUT}' seconds and CLI delay of '${CLI_DELAY}' seconds and using database '${DATABASE}'" - echo -elif [ "$MODE" == "down" ]; then - EXPMODE="Stopping network" -elif [ "$MODE" == "generate" ]; then - EXPMODE="Generating certs and organization definition for Org3" -else - printHelp - exit 1 -fi + +MODE=$1; +shift + while getopts "h?c:t:d:f:s:l:i:v" opt; do case "$opt" in h|\?) @@ -214,6 +202,19 @@ while getopts "h?c:t:d:f:s:l:i:v" opt; do esac done +# Determine whether starting, stopping, restarting or generating for announce +if [ "$MODE" == "up" ]; then + echo "Add Org3 to channel '${CHANNEL_NAME}' with '${CLI_TIMEOUT}' seconds and CLI delay of '${CLI_DELAY}' seconds and using database '${DATABASE}'" + echo +elif [ "$MODE" == "down" ]; then + EXPMODE="Stopping network" +elif [ "$MODE" == "generate" ]; then + EXPMODE="Generating certs and organization definition for Org3" +else + printHelp + exit 1 +fi + #Create the network using docker compose if [ "${MODE}" == "up" ]; then networkUp diff --git a/test-network/add-org3/configtx.yaml b/test-network/addOrg3/configtx.yaml similarity index 100% rename from test-network/add-org3/configtx.yaml rename to test-network/addOrg3/configtx.yaml diff --git a/test-network/add-org3/docker/docker-compose-couch-org3.yaml b/test-network/addOrg3/docker/docker-compose-couch-org3.yaml similarity index 100% rename from test-network/add-org3/docker/docker-compose-couch-org3.yaml rename to test-network/addOrg3/docker/docker-compose-couch-org3.yaml diff --git a/test-network/add-org3/docker/docker-compose-org3.yaml b/test-network/addOrg3/docker/docker-compose-org3.yaml similarity index 100% rename from test-network/add-org3/docker/docker-compose-org3.yaml rename to test-network/addOrg3/docker/docker-compose-org3.yaml diff --git a/test-network/add-org3/org3-crypto.yaml b/test-network/addOrg3/org3-crypto.yaml similarity index 100% rename from test-network/add-org3/org3-crypto.yaml rename to test-network/addOrg3/org3-crypto.yaml diff --git a/test-network/network.sh b/test-network/network.sh index 8ece694c13..1dc20182b1 100755 --- a/test-network/network.sh +++ b/test-network/network.sh @@ -435,9 +435,9 @@ COMPOSE_FILE_COUCH=docker/docker-compose-couch.yaml # certificate authorities compose file COMPOSE_FILE_CA=docker/docker-compose-ca.yaml # use this as the docker compose couch file for org3 -COMPOSE_FILE_COUCH_ORG3=add-org3/docker/docker-compose-couch-org3.yaml +COMPOSE_FILE_COUCH_ORG3=addOrg3/docker/docker-compose-couch-org3.yaml # use this as the default docker-compose yaml definition for org3 -COMPOSE_FILE_ORG3=add-org3/docker/docker-compose-org3.yaml +COMPOSE_FILE_ORG3=addOrg3/docker/docker-compose-org3.yaml # # use golang as the default language for chaincode CC_RUNTIME_LANGUAGE=golang