mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Improve BFT sample on test-network (#1083)
This patch includes: - Fixed a minor bug in the parsing of the BFT flag - Added check for when a user attempts to use BFT orderer in Fabric network with CA - Update of printHelp for use of the BFT flag - Fixed explanations Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This commit is contained in:
parent
eb16caf3d5
commit
7d5aaf11e2
4 changed files with 23 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -448,7 +448,6 @@ while [[ $# -ge 1 ]] ; do
|
|||
;;
|
||||
-bft )
|
||||
BFT=1
|
||||
shift
|
||||
;;
|
||||
-ca )
|
||||
CRYPTO="Certificate Authorities"
|
||||
|
|
@ -513,6 +512,11 @@ while [[ $# -ge 1 ]] ; do
|
|||
shift
|
||||
done
|
||||
|
||||
## Check if user attempts to use BFT orderer and CA together
|
||||
if [[ $BFT -eq 1 && "$CRYPTO" == "Certificate Authorities" ]]; then
|
||||
fatalln "This sample does not yet support the use of consensus type BFT and CA together."
|
||||
fi
|
||||
|
||||
if [ $BFT -eq 1 ]; then
|
||||
export FABRIC_CFG_PATH=${PWD}/bft-config
|
||||
COMPOSE_FILE_BASE=compose-bft-test-net.yaml
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ function printHelp() {
|
|||
println " network.sh \033[0;32mup\033[0m [Flags]"
|
||||
println
|
||||
println " Flags:"
|
||||
println " -ca <use CAs> - 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 <channel name> - Name of channel to create (defaults to \"mychannel\")"
|
||||
println " -s <dbtype> - Peer state database to deploy: goleveldb (default) or couchdb"
|
||||
println " -r <max retry> - 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 <channel name> - Name of channel to create (defaults to \"mychannel\")"
|
||||
println " -r <max retry> - CLI times out after certain number of attempts (defaults to 5)"
|
||||
println " -d <delay> - 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 CAs> - 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 <channel name> - Name of channel to create (defaults to \"mychannel\")"
|
||||
println " -s <dbtype> - Peer state database to deploy: goleveldb (default) or couchdb"
|
||||
println " -r <max retry> - 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:"
|
||||
|
|
|
|||
Loading…
Reference in a new issue