Skip to content

Commit

Permalink
[FAB-16284] Remove E2E file and -f option from BYFN
Browse files Browse the repository at this point in the history
The docker-compose-e2e-template.yaml file and generated
docker-compose-e2e.yaml file should not be used any more,
and should be removed. The associated Docker Compose
file argument (-f docker-compose-e2e.yaml) should also
be removed.

Users wishing to deploy BYFN with a CA should use the new
-a option, and we should probably just make that the default
anyway.

There are associated documentation changes required for
this which I will do in another CR.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ie7fc0b809b44cbb2a7d55865ce8f3e887e0e7c58
  • Loading branch information
Simon Stone committed Aug 12, 2019
1 parent 3907507 commit 86cd831
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 48 deletions.
1 change: 0 additions & 1 deletion first-network/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/channel-artifacts/*.tx
/channel-artifacts/*.block
/crypto-config/*
/docker-compose-e2e.yaml
/ledgers
/ledgers-backup
/channel-artifacts/*.json
Expand Down
42 changes: 1 addition & 41 deletions first-network/byfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function printHelp() {
echo " -c <channel name> - channel name to use (defaults to \"mychannel\")"
echo " -t <timeout> - CLI timeout duration in seconds (defaults to 10)"
echo " -d <delay> - delay duration in seconds (defaults to 3)"
echo " -f <docker-compose-file> - specify which docker-compose file use (defaults to docker-compose-cli.yaml)"
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
echo " -l <language> - the programming language of the chaincode to deploy: go (default), javascript, or java"
echo " -o <consensus-type> - the consensus-type of the ordering service: solo (default) or etcdraft"
Expand Down Expand Up @@ -277,41 +276,6 @@ function networkDown() {
removeUnwantedImages
# remove orderer block and other channel configuration transactions and certs
rm -rf channel-artifacts/*.block channel-artifacts/*.tx crypto-config ./org3-artifacts/crypto-config/ channel-artifacts/org3.json
# remove the docker-compose yaml file that was customized to the example
rm -f docker-compose-e2e.yaml
fi
}

# Using docker-compose-e2e-template.yaml, replace constants with private key file names
# generated by the cryptogen tool and output a docker-compose.yaml specific to this
# configuration
function replacePrivateKey() {
# sed on MacOSX does not support -i flag with a null extension. We will use
# 't' for our back-up's extension and delete it at the end of the function
ARCH=$(uname -s | grep Darwin)
if [ "$ARCH" == "Darwin" ]; then
OPTS="-it"
else
OPTS="-i"
fi

# Copy the template to the file that will be modified to add the private key
cp docker-compose-e2e-template.yaml docker-compose-e2e.yaml

# The next steps will replace the template's contents with the
# actual values of the private key file names for the two CAs.
CURRENT_DIR=$PWD
cd crypto-config/peerOrganizations/org1.example.com/ca/
PRIV_KEY=$(ls *_sk)
cd "$CURRENT_DIR"
sed $OPTS "s/CA1_PRIVATE_KEY/${PRIV_KEY}/g" docker-compose-e2e.yaml
cd crypto-config/peerOrganizations/org2.example.com/ca/
PRIV_KEY=$(ls *_sk)
cd "$CURRENT_DIR"
sed $OPTS "s/CA2_PRIVATE_KEY/${PRIV_KEY}/g" docker-compose-e2e.yaml
# If MacOSX, remove the temporary backup of the docker-compose file
if [ "$ARCH" == "Darwin" ]; then
rm docker-compose-e2e.yamlt
fi
}

Expand Down Expand Up @@ -515,7 +479,7 @@ else
exit 1
fi

while getopts "h?c:t:d:f:s:l:i:o:anv" opt; do
while getopts "h?c:t:d:s:l:i:o:anv" opt; do
case "$opt" in
h | \?)
printHelp
Expand All @@ -530,9 +494,6 @@ while getopts "h?c:t:d:f:s:l:i:o:anv" opt; do
d)
CLI_DELAY=$OPTARG
;;
f)
COMPOSE_FILE=$OPTARG
;;
s)
IF_COUCHDB=$OPTARG
;;
Expand Down Expand Up @@ -576,7 +537,6 @@ elif [ "${MODE}" == "down" ]; then ## Clear the network
networkDown
elif [ "${MODE}" == "generate" ]; then ## Generate Artifacts
generateCerts
replacePrivateKey
generateChannelArtifacts
elif [ "${MODE}" == "restart" ]; then ## Restart the network
networkDown
Expand Down
7 changes: 1 addition & 6 deletions first-network/eyfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function printHelp () {
echo " -c <channel name> - channel name to use (defaults to \"mychannel\")"
echo " -t <timeout> - CLI timeout duration in seconds (defaults to 10)"
echo " -d <delay> - delay duration in seconds (defaults to 3)"
echo " -f <docker-compose-file> - specify which docker-compose file use (defaults to docker-compose-cli.yaml)"
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
echo " -l <language> - the programming language of the chaincode to deploy: go (default), javascript, or java"
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
Expand Down Expand Up @@ -136,8 +135,6 @@ function networkDown () {
removeUnwantedImages
# remove orderer block and other channel configuration transactions and certs
rm -rf channel-artifacts/*.block channel-artifacts/*.tx crypto-config ./org3-artifacts/crypto-config/ channel-artifacts/org3.json
# remove the docker-compose yaml file that was customized to the example
rm -f docker-compose-e2e.yaml
fi
}

Expand Down Expand Up @@ -258,7 +255,7 @@ else
printHelp
exit 1
fi
while getopts "h?c:t:d:f:s:l:i:v" opt; do
while getopts "h?c:t:d:s:l:i:v" opt; do
case "$opt" in
h|\?)
printHelp
Expand All @@ -270,8 +267,6 @@ while getopts "h?c:t:d:f:s:l:i:v" opt; do
;;
d) CLI_DELAY=$OPTARG
;;
f) COMPOSE_FILE=$OPTARG
;;
s) IF_COUCHDB=$OPTARG
;;
l) CC_SRC_LANGUAGE=$OPTARG
Expand Down

0 comments on commit 86cd831

Please sign in to comment.