diff --git a/ci/scripts/run-test-network-basic.sh b/ci/scripts/run-test-network-basic.sh index 285fdb5e..5350e1d8 100755 --- a/ci/scripts/run-test-network-basic.sh +++ b/ci/scripts/run-test-network-basic.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} CHAINCODE_NAME=${CHAINCODE_NAME:-basic} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-basic} @@ -14,7 +13,7 @@ function print() { function createNetwork() { print "Creating network" - ./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}" + ./network.sh up createChannel -ca -s couchdb print "Deploying ${CHAINCODE_NAME} chaincode" ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" } diff --git a/ci/scripts/run-test-network-events.sh b/ci/scripts/run-test-network-events.sh index 836d130e..cc04731f 100755 --- a/ci/scripts/run-test-network-events.sh +++ b/ci/scripts/run-test-network-events.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-javascript} CHAINCODE_NAME=${CHAINCODE_NAME:-events} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-events} diff --git a/ci/scripts/run-test-network-ledger.sh b/ci/scripts/run-test-network-ledger.sh index 19258bcb..91919c49 100755 --- a/ci/scripts/run-test-network-ledger.sh +++ b/ci/scripts/run-test-network-ledger.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} CHAINCODE_NAME=${CHAINCODE_NAME:-ledger} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-ledger-queries} @@ -14,7 +13,7 @@ function print() { function createNetwork() { print "Creating network" - ./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}" + ./network.sh up createChannel -ca -s couchdb print "Deploying ${CHAINCODE_NAME} chaincode" ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" } diff --git a/ci/scripts/run-test-network-private.sh b/ci/scripts/run-test-network-private.sh index 7178bcf5..af2d22aa 100755 --- a/ci/scripts/run-test-network-private.sh +++ b/ci/scripts/run-test-network-private.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} CHAINCODE_NAME=${CHAINCODE_NAME:-private} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-private-data} @@ -14,7 +13,7 @@ function print() { function createNetwork() { print "Creating network" - ./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}" + ./network.sh up createChannel -ca -s couchdb print "Deploying ${CHAINCODE_NAME} chaincode" ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json } diff --git a/ci/scripts/run-test-network-sbe.sh b/ci/scripts/run-test-network-sbe.sh index 434bdcb9..b388d112 100755 --- a/ci/scripts/run-test-network-sbe.sh +++ b/ci/scripts/run-test-network-sbe.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-typescript} CHAINCODE_NAME=${CHAINCODE_NAME:-sbe} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-sbe} @@ -14,7 +13,7 @@ function print() { function createNetwork() { print "Creating network" - ./network.sh up createChannel -ca -s couchdb -i "${FABRIC_VERSION}" + ./network.sh up createChannel -ca -s couchdb print "Deploying ${CHAINCODE_NAME} chaincode" ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" } diff --git a/ci/scripts/run-test-network-secured.sh b/ci/scripts/run-test-network-secured.sh index c10eed40..cce1721a 100755 --- a/ci/scripts/run-test-network-secured.sh +++ b/ci/scripts/run-test-network-secured.sh @@ -1,6 +1,5 @@ set -euo pipefail -FABRIC_VERSION=${FABRIC_VERSION:-2.4} CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} CHAINCODE_NAME=${CHAINCODE_NAME:-secured} CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-secured-agreement} diff --git a/ci/templates/commercial-paper/azure-pipelines-go.yml b/ci/templates/commercial-paper/azure-pipelines-go.yml index b4429507..4363dd1d 100644 --- a/ci/templates/commercial-paper/azure-pipelines-go.yml +++ b/ci/templates/commercial-paper/azure-pipelines-go.yml @@ -18,7 +18,7 @@ steps: displayName: Vendor DigiBank Dependencies - script: | - ./network.sh up createChannel -ca -s couchdb -i ${FABRIC_VERSION} # FABRIC_VERSION is set in ci/azure-pipelines.yml + ./network.sh up createChannel -ca -s couchdb # Copy the connection profiles so they are in the correct organizations. cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/" diff --git a/ci/templates/commercial-paper/azure-pipelines-java.yml b/ci/templates/commercial-paper/azure-pipelines-java.yml index 4bb00d60..057a41f4 100644 --- a/ci/templates/commercial-paper/azure-pipelines-java.yml +++ b/ci/templates/commercial-paper/azure-pipelines-java.yml @@ -13,7 +13,7 @@ steps: displayName: Build MagnetoCorp Java Contract - script: | - ./network.sh up createChannel -ca -s couchdb -i ${FABRIC_VERSION} # FABRIC_VERSION is set in ci/azure-pipelines.yml + ./network.sh up createChannel -ca -s couchdb # Copy the connection profiles so they are in the correct organizations. cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/" diff --git a/ci/templates/commercial-paper/azure-pipelines-javascript.yml b/ci/templates/commercial-paper/azure-pipelines-javascript.yml index a7661ed1..e4444057 100644 --- a/ci/templates/commercial-paper/azure-pipelines-javascript.yml +++ b/ci/templates/commercial-paper/azure-pipelines-javascript.yml @@ -4,7 +4,7 @@ steps: - script: | - ./network.sh up createChannel -ca -s couchdb -i ${FABRIC_VERSION} # FABRIC_VERSION is set in ci/azure-pipelines.yml + ./network.sh up createChannel -ca -s couchdb # Copy the connection profiles so they are in the correct organizations. cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/" diff --git a/interest_rate_swaps/network/network.sh b/interest_rate_swaps/network/network.sh index d43a736b..23767018 100755 --- a/interest_rate_swaps/network/network.sh +++ b/interest_rate_swaps/network/network.sh @@ -27,13 +27,12 @@ export VERBOSE=false # Print the usage message function printHelp() { echo "Usage: " - echo " start_network.sh [-t ] [-i ] [-v]" + echo " start_network.sh [-t ] [-v]" echo " - one of 'up', 'down' or 'generate'" echo " - 'up' - bring up the network with docker-compose up" echo " - 'down' - clear the network with docker-compose down" echo " - 'generate' - generate required certificates and genesis block" echo " -t - CLI timeout duration in seconds (defaults to 10)" - echo " -i - the tag to be used to launch the network (defaults to \"latest\")" echo " -v - verbose mode" echo echo "Typically, one would first generate the required certificates and " @@ -73,7 +72,7 @@ function checkPrereqs() { # Note, we check configtxlator externally because it does not require a config file, and peer in the # docker image because of FAB-8551 that makes configtxlator return 'development version' in docker LOCAL_VERSION=$(configtxgen -version | sed -ne 's/ Version: //p') - DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-tools:$IMAGETAG peer version | sed -ne 's/ Version: //p' | head -1) + DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-tools:latest peer version | sed -ne 's/ Version: //p' | head -1) echo "LOCAL_VERSION=$LOCAL_VERSION" echo "DOCKER_IMAGE_VERSION=$DOCKER_IMAGE_VERSION" @@ -108,7 +107,7 @@ function networkUp() { generateCerts generateChannelArtifacts fi - IMAGE_TAG=$IMAGETAG docker-compose -f $COMPOSE_FILE up -d orderer partya partyb partyc auditor rrprovider cli 2>&1 + docker-compose -f $COMPOSE_FILE up -d orderer partya partyb partyc auditor rrprovider cli 2>&1 if [ $? -ne 0 ]; then echo "ERROR !!!! Unable to start network" exit 1 @@ -133,7 +132,7 @@ function networkDown() { # Bring down the network, deleting the volumes #Delete any ledger backups - docker run -v "$PWD:/tmp/first-network" --rm hyperledger/fabric-tools:$IMAGETAG rm -Rf /tmp/first-network/ledgers-backup + docker run -v "$PWD:/tmp/first-network" --rm hyperledger/fabric-tools:latest rm -Rf /tmp/first-network/ledgers-backup #Cleanup the chaincode containers clearContainers #Cleanup images @@ -191,10 +190,6 @@ function generateChannelArtifacts() { CHANNEL_NAME="irs" COMPOSE_FILE=docker-compose.yaml -COMPOSE_PROJECT_NAME=fabric-irs -# -# default image tag -IMAGETAG="latest" # Parse commandline args MODE=$1 shift @@ -215,9 +210,6 @@ while getopts "t:i:v" opt; do t) CLI_TIMEOUT=$OPTARG ;; - i) - IMAGETAG=$(go env GOARCH)"-"$OPTARG - ;; v) VERBOSE=true ;; diff --git a/test-network/addOrg3/addOrg3.sh b/test-network/addOrg3/addOrg3.sh index da0ee19a..1f5bf97b 100755 --- a/test-network/addOrg3/addOrg3.sh +++ b/test-network/addOrg3/addOrg3.sh @@ -31,8 +31,6 @@ function printHelp () { echo " -t - CLI timeout duration in seconds (defaults to 10)" echo " -d - delay duration in seconds (defaults to 3)" echo " -s - the database backend to use: goleveldb (default) or couchdb" - echo " -i - the tag to be used to launch the network (defaults to \"latest\")" - echo " -cai - the image tag to be used for CA (defaults to \"${CA_IMAGETAG}\")" echo " -verbose - verbose mode" echo echo "Typically, one would first generate the required certificates and " @@ -86,8 +84,7 @@ function generateOrg3() { fi infoln "Generating certificates using Fabric CA" - - IMAGE_TAG=${CA_IMAGETAG} docker-compose -f $COMPOSE_FILE_CA_ORG3 up -d 2>&1 + docker-compose -f $COMPOSE_FILE_CA_ORG3 up -d 2>&1 . fabric-ca/registerEnroll.sh @@ -122,9 +119,9 @@ function generateOrg3Definition() { function Org3Up () { # start org3 nodes if [ "${DATABASE}" == "couchdb" ]; then - IMAGE_TAG=${IMAGETAG} docker-compose -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH_ORG3 up -d 2>&1 + docker-compose -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH_ORG3 up -d 2>&1 else - IMAGE_TAG=$IMAGETAG docker-compose -f $COMPOSE_FILE_ORG3 up -d 2>&1 + docker-compose -f $COMPOSE_FILE_ORG3 up -d 2>&1 fi if [ $? -ne 0 ]; then fatalln "ERROR !!!! Unable to start Org3 network" @@ -183,10 +180,6 @@ COMPOSE_FILE_COUCH_ORG3=docker/docker-compose-couch-org3.yaml COMPOSE_FILE_ORG3=docker/docker-compose-org3.yaml # certificate authorities compose file COMPOSE_FILE_CA_ORG3=docker/docker-compose-ca-org3.yaml -# default image tag -IMAGETAG="latest" -# default ca image tag -CA_IMAGETAG="latest" # database DATABASE="leveldb" @@ -229,14 +222,6 @@ while [[ $# -ge 1 ]] ; do DATABASE="$2" shift ;; - -i ) - IMAGETAG=$(go env GOARCH)"-""$2" - shift - ;; - -cai ) - CA_IMAGETAG="$2" - shift - ;; -verbose ) VERBOSE=true shift diff --git a/test-network/network.sh b/test-network/network.sh index 90de2b0b..24b9481e 100755 --- a/test-network/network.sh +++ b/test-network/network.sh @@ -54,7 +54,7 @@ function checkPrereqs() { # use the fabric tools container to see if the samples and binaries match your # docker images LOCAL_VERSION=$(peer version | sed -ne 's/ Version: //p') - DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-tools:$IMAGETAG peer version | sed -ne 's/ Version: //p' | head -1) + DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-tools:latest peer version | sed -ne 's/ Version: //p' | head -1) infoln "LOCAL_VERSION=$LOCAL_VERSION" infoln "DOCKER_IMAGE_VERSION=$DOCKER_IMAGE_VERSION" @@ -87,7 +87,7 @@ function checkPrereqs() { exit 1 fi CA_LOCAL_VERSION=$(fabric-ca-client version | sed -ne 's/ Version: //p') - CA_DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-ca:$CA_IMAGETAG fabric-ca-client version | sed -ne 's/ Version: //p' | head -1) + CA_DOCKER_IMAGE_VERSION=$(docker run --rm hyperledger/fabric-ca:latest fabric-ca-client version | sed -ne 's/ Version: //p' | head -1) infoln "CA_LOCAL_VERSION=$CA_LOCAL_VERSION" infoln "CA_DOCKER_IMAGE_VERSION=$CA_DOCKER_IMAGE_VERSION" @@ -170,8 +170,7 @@ function createOrgs() { # Create crypto material using Fabric CA if [ "$CRYPTO" == "Certificate Authorities" ]; then infoln "Generating certificates using Fabric CA" - - IMAGE_TAG=${CA_IMAGETAG} docker-compose -f $COMPOSE_FILE_CA up -d 2>&1 + docker-compose -f $COMPOSE_FILE_CA up -d 2>&1 . organizations/fabric-ca/registerEnroll.sh @@ -242,7 +241,7 @@ function networkUp() { COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_COUCH}" fi - IMAGE_TAG=$IMAGETAG docker-compose ${COMPOSE_FILES} up -d 2>&1 + docker-compose ${COMPOSE_FILES} up -d 2>&1 docker ps -a if [ $? -ne 0 ]; then @@ -336,10 +335,6 @@ CC_SRC_LANGUAGE="NA" CC_VERSION="1.0" # Chaincode definition sequence CC_SEQUENCE=1 -# default image tag -IMAGETAG="latest" -# default ca image tag -CA_IMAGETAG="latest" # default database DATABASE="leveldb" @@ -423,14 +418,6 @@ while [[ $# -ge 1 ]] ; do CC_INIT_FCN="$2" shift ;; - -i ) - IMAGETAG="$2" - shift - ;; - -cai ) - CA_IMAGETAG="$2" - shift - ;; -verbose ) VERBOSE=true shift diff --git a/test-network/scripts/utils.sh b/test-network/scripts/utils.sh index 125cfb7e..a57bd148 100755 --- a/test-network/scripts/utils.sh +++ b/test-network/scripts/utils.sh @@ -19,18 +19,16 @@ function printHelp() { println " -s - Peer state database to deploy: goleveldb (default) or couchdb" println " -r - CLI times out after certain number of attempts (defaults to 5)" println " -d - CLI delays for a certain number of seconds (defaults to 3)" - println " -i - Docker image tag of Fabric to deploy (defaults to \"latest\")" - println " -cai - Docker image tag of Fabric CA to deploy (defaults to \"${CA_IMAGETAG}\")" println " -verbose - Verbose mode" println println " -h - Print this message" println println " Possible Mode and flag combinations" - println " \033[0;32mup\033[0m -ca -r -d -s -i -cai -verbose" - println " \033[0;32mup createChannel\033[0m -ca -c -r -d -s -i -cai -verbose" + println " \033[0;32mup\033[0m -ca -r -d -s -verbose" + println " \033[0;32mup createChannel\033[0m -ca -c -r -d -s -verbose" println println " Examples:" - println " network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0" + println " network.sh up createChannel -ca -c mychannel -s couchdb " elif [ "$USAGE" == "createChannel" ]; then println "Usage: " println " network.sh \033[0;32mcreateChannel\033[0m [Flags]" @@ -88,8 +86,6 @@ function printHelp() { println " -s - Peer state database to deploy: goleveldb (default) or couchdb" println " -r - CLI times out after certain number of attempts (defaults to 5)" println " -d - CLI delays for a certain number of seconds (defaults to 3)" - println " -i - Docker image tag of Fabric to deploy (defaults to \"latest\")" - println " -cai - Docker image tag of Fabric CA to deploy (defaults to \"${CA_IMAGETAG}\")" println " -verbose - Verbose mode" println println " Used with \033[0;32mnetwork.sh deployCC\033[0m" @@ -106,13 +102,13 @@ function printHelp() { println " -h - Print this message" println println " Possible Mode and flag combinations" - println " \033[0;32mup\033[0m -ca -r -d -s -i -cai -verbose" - println " \033[0;32mup createChannel\033[0m -ca -c -r -d -s -i -cai -verbose" + println " \033[0;32mup\033[0m -ca -r -d -s -verbose" + println " \033[0;32mup createChannel\033[0m -ca -c -r -d -s -verbose" println " \033[0;32mcreateChannel\033[0m -c -r -d -verbose" println " \033[0;32mdeployCC\033[0m -ccn -ccl -ccv -ccs -ccp -cci -r -d -verbose" println println " Examples:" - println " network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0" + println " network.sh up createChannel -ca -c mychannel -s couchdb" println " network.sh createChannel -c channelName" println " network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript" println " network.sh deployCC -ccn mychaincode -ccp ./user/mychaincode -ccv 1 -ccl javascript"