diff --git a/test-network/README.md b/test-network/README.md index b43d27a1c3..31578af11f 100644 --- a/test-network/README.md +++ b/test-network/README.md @@ -2,7 +2,7 @@ You can use the `./network.sh` script to stand up a simple Fabric test network. The test network has two peer organizations with one peer each and a single node raft ordering service. You can also use the `./network.sh` script to create channels and deploy chaincode. For more information, see [Using the Fabric test network](https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html). The test network is being introduced in Fabric v2.0 as the long term replacement for the `first-network` sample. -If you are planning to run the test network with consesnsus type BFT then please pass `-bft` flag as input to the `network.sh` script when creating the channel. +If you are planning to run the test network with consensus type BFT then please pass `-bft` flag as input to the `network.sh` script when creating the channel. Note that currently this sample does not yet support the use of consensus type BFT and CA together. That is to create a network use: ```bash ./network.sh up -bft diff --git a/test-network/network.sh b/test-network/network.sh index 9af3026489..bd231cc6c4 100755 --- a/test-network/network.sh +++ b/test-network/network.sh @@ -448,7 +448,6 @@ while [[ $# -ge 1 ]] ; do ;; -bft ) BFT=1 - shift ;; -ca ) CRYPTO="Certificate Authorities" diff --git a/test-network/scripts/createChannel.sh b/test-network/scripts/createChannel.sh index d82214d18f..f51bfa9000 100755 --- a/test-network/scripts/createChannel.sh +++ b/test-network/scripts/createChannel.sh @@ -94,6 +94,10 @@ setAnchorPeer() { } +## User attempts to use BFT orderer in Fabric network with CA +if [ $BFT -eq 1 ] && [ -d "organizations/fabric-ca/ordererOrg/msp" ]; then + fatalln "Fabric network seems to be using CA. This sample does not yet support the use of consensus type BFT and CA together." +fi ## Create channel genesis block FABRIC_CFG_PATH=$PWD/../config/ diff --git a/test-network/scripts/utils.sh b/test-network/scripts/utils.sh index 6075e9142a..e5a7aca67f 100755 --- a/test-network/scripts/utils.sh +++ b/test-network/scripts/utils.sh @@ -14,7 +14,8 @@ function printHelp() { println " network.sh \033[0;32mup\033[0m [Flags]" println println " Flags:" - println " -ca - Use Certificate Authorities to generate network crypto material" + println " -ca - Use Certificate Authorities to generate network crypto material" + println " -bft - Use Orderers with consensus type BFT (Not available in Fabric v2.x)" println " -c - Name of channel to create (defaults to \"mychannel\")" println " -s - Peer state database to deploy: goleveldb (default) or couchdb" println " -r - CLI times out after certain number of attempts (defaults to 5)" @@ -25,15 +26,19 @@ function printHelp() { println println " Possible Mode and flag combinations" println " \033[0;32mup\033[0m -ca -r -d -s -verbose" + println " \033[0;32mup\033[0m -bft -r -d -s -verbose" println " \033[0;32mup createChannel\033[0m -ca -c -r -d -s -verbose" + println " \033[0;32mup createChannel\033[0m -bft -c -r -d -s -verbose" println println " Examples:" println " network.sh up createChannel -ca -c mychannel -s couchdb " + println " network.sh up createChannel -bft -c mychannel -s couchdb " elif [ "$USAGE" == "createChannel" ]; then println "Usage: " println " network.sh \033[0;32mcreateChannel\033[0m [Flags]" println println " Flags:" + println " -bft - Use Orderers with consensus type BFT (Not available in Fabric v2.x)" println " -c - Name of channel to create (defaults to \"mychannel\")" 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)" @@ -42,10 +47,11 @@ function printHelp() { println " -h - Print this message" println println " Possible Mode and flag combinations" - println " \033[0;32mcreateChannel\033[0m -c -r -d -verbose" + println " \033[0;32mcreateChannel\033[0m -bft -c -r -d -verbose" println println " Examples:" println " network.sh createChannel -c channelName" + println " network.sh createChannel -bft" elif [ "$USAGE" == "deployCC" ]; then println "Usage: " println " network.sh \033[0;32mdeployCC\033[0m [Flags]" @@ -104,7 +110,8 @@ function printHelp() { println println " Flags:" println " Used with \033[0;32mnetwork.sh up\033[0m, \033[0;32mnetwork.sh createChannel\033[0m:" - println " -ca - Use Certificate Authorities to generate network crypto material" + println " -ca - Use Certificate Authorities to generate network crypto material" + println " -bft - Use Orderers with consensus type BFT (Not available in Fabric v2.x)" println " -c - Name of channel to create (defaults to \"mychannel\")" println " -s - Peer state database to deploy: goleveldb (default) or couchdb" println " -r - CLI times out after certain number of attempts (defaults to 5)" @@ -126,8 +133,10 @@ function printHelp() { println println " Possible Mode and flag combinations" println " \033[0;32mup\033[0m -ca -r -d -s -verbose" + println " \033[0;32mup\033[0m -bft -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;32mup createChannel\033[0m -bft -c -r -d -s -verbose" + println " \033[0;32mcreateChannel\033[0m -bft -c -r -d -verbose" println " \033[0;32mdeployCC\033[0m -ccn -ccl -ccv -ccs -ccp -cci -r -d -verbose" println println " Examples:"