mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-21 17:15:10 +00:00
[FAB-16133] Remove Solo consensus from BYFN
A Solo ordering node offers no benefits over a single node Raft ordering node. Raft is the best practice for Fabric v2.0, and should be the only option in the BYFN sample going forwards. This CR removes Solo and the consensus related options from BYFN, and always uses Raft. Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: I686cb68d8bc8fc9a231a0fa680263175451f2820
This commit is contained in:
parent
91c720a7ff
commit
18712ca8f6
2 changed files with 8 additions and 48 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
# Fabric network.
|
# Fabric network.
|
||||||
#
|
#
|
||||||
# The end-to-end verification provisions a sample Fabric network consisting of
|
# The end-to-end verification provisions a sample Fabric network consisting of
|
||||||
# two organizations, each maintaining two peers, and a “solo” ordering service.
|
# two organizations, each maintaining two peers, and a Raft ordering service.
|
||||||
#
|
#
|
||||||
# This verification makes use of two fundamental tools, which are necessary to
|
# This verification makes use of two fundamental tools, which are necessary to
|
||||||
# create a functioning transactional network with digital signature validation
|
# create a functioning transactional network with digital signature validation
|
||||||
|
|
@ -47,7 +47,6 @@ function printHelp() {
|
||||||
echo " -d <delay> - delay duration in seconds (defaults to 3)"
|
echo " -d <delay> - delay duration in seconds (defaults to 3)"
|
||||||
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
|
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 " -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"
|
|
||||||
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
||||||
echo " -a - launch certificate authorities (no certificate authorities are launched by default)"
|
echo " -a - launch certificate authorities (no certificate authorities are launched by default)"
|
||||||
echo " -n - do not deploy chaincode (abstore chaincode is deployed by default)"
|
echo " -n - do not deploy chaincode (abstore chaincode is deployed by default)"
|
||||||
|
|
@ -157,15 +156,12 @@ function networkUp() {
|
||||||
replacePrivateKey
|
replacePrivateKey
|
||||||
generateChannelArtifacts
|
generateChannelArtifacts
|
||||||
fi
|
fi
|
||||||
COMPOSE_FILES="-f ${COMPOSE_FILE}"
|
COMPOSE_FILES="-f ${COMPOSE_FILE} -f ${COMPOSE_FILE_RAFT2}"
|
||||||
if [ "${CERTIFICATE_AUTHORITIES}" == "true" ]; then
|
if [ "${CERTIFICATE_AUTHORITIES}" == "true" ]; then
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_CA}"
|
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_CA}"
|
||||||
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
|
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
|
||||||
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
|
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
|
||||||
fi
|
fi
|
||||||
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
|
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
|
|
||||||
fi
|
|
||||||
if [ "${IF_COUCHDB}" == "couchdb" ]; then
|
if [ "${IF_COUCHDB}" == "couchdb" ]; then
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_COUCH}"
|
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_COUCH}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -176,11 +172,8 @@ function networkUp() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CONSENSUS_TYPE" == "etcdraft" ]; then
|
echo "Sleeping 15s to allow Raft cluster to complete booting"
|
||||||
sleep 1
|
sleep 15
|
||||||
echo "Sleeping 15s to allow $CONSENSUS_TYPE cluster to complete booting"
|
|
||||||
sleep 14
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${NO_CHAINCODE}" != "true" ]; then
|
if [ "${NO_CHAINCODE}" != "true" ]; then
|
||||||
echo Vendoring Go dependencies ...
|
echo Vendoring Go dependencies ...
|
||||||
|
|
@ -215,15 +208,12 @@ function upgradeNetwork() {
|
||||||
mkdir -p $LEDGERS_BACKUP
|
mkdir -p $LEDGERS_BACKUP
|
||||||
|
|
||||||
export IMAGE_TAG=$IMAGETAG
|
export IMAGE_TAG=$IMAGETAG
|
||||||
COMPOSE_FILES="-f ${COMPOSE_FILE}"
|
COMPOSE_FILES="-f ${COMPOSE_FILE} -f ${COMPOSE_FILE_RAFT2}"
|
||||||
if [ "${CERTIFICATE_AUTHORITIES}" == "true" ]; then
|
if [ "${CERTIFICATE_AUTHORITIES}" == "true" ]; then
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_CA}"
|
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_CA}"
|
||||||
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
|
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
|
||||||
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
|
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
|
||||||
fi
|
fi
|
||||||
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
|
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
|
|
||||||
fi
|
|
||||||
if [ "${IF_COUCHDB}" == "couchdb" ]; then
|
if [ "${IF_COUCHDB}" == "couchdb" ]; then
|
||||||
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_COUCH}"
|
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_COUCH}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -382,19 +372,8 @@ function generateChannelArtifacts() {
|
||||||
echo "##########################################################"
|
echo "##########################################################"
|
||||||
# Note: For some unknown reason (at least for now) the block file can't be
|
# Note: For some unknown reason (at least for now) the block file can't be
|
||||||
# named orderer.genesis.block or the orderer will fail to launch!
|
# named orderer.genesis.block or the orderer will fail to launch!
|
||||||
echo "CONSENSUS_TYPE="$CONSENSUS_TYPE
|
configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
|
||||||
set -x
|
|
||||||
if [ "$CONSENSUS_TYPE" == "solo" ]; then
|
|
||||||
configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
|
|
||||||
elif [ "$CONSENSUS_TYPE" == "etcdraft" ]; then
|
|
||||||
configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
|
|
||||||
else
|
|
||||||
set +x
|
|
||||||
echo "unrecognized CONSESUS_TYPE='$CONSENSUS_TYPE'. exiting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
res=$?
|
res=$?
|
||||||
set +x
|
|
||||||
if [ $res -ne 0 ]; then
|
if [ $res -ne 0 ]; then
|
||||||
echo "Failed to generate orderer genesis block..."
|
echo "Failed to generate orderer genesis block..."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -463,8 +442,6 @@ COMPOSE_FILE_CA=docker-compose-ca.yaml
|
||||||
CC_SRC_LANGUAGE=go
|
CC_SRC_LANGUAGE=go
|
||||||
# default image tag
|
# default image tag
|
||||||
IMAGETAG="latest"
|
IMAGETAG="latest"
|
||||||
# default consensus type
|
|
||||||
CONSENSUS_TYPE="solo"
|
|
||||||
# Parse commandline args
|
# Parse commandline args
|
||||||
if [ "$1" = "-m" ]; then # supports old usage, muscle memory is powerful!
|
if [ "$1" = "-m" ]; then # supports old usage, muscle memory is powerful!
|
||||||
shift
|
shift
|
||||||
|
|
@ -487,7 +464,7 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "h?c:t:d:s:l:i:o:anv" opt; do
|
while getopts "h?c:t:d:s:l:i:anv" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
h | \?)
|
h | \?)
|
||||||
printHelp
|
printHelp
|
||||||
|
|
@ -511,9 +488,6 @@ while getopts "h?c:t:d:s:l:i:o:anv" opt; do
|
||||||
i)
|
i)
|
||||||
IMAGETAG=$(go env GOARCH)"-"$OPTARG
|
IMAGETAG=$(go env GOARCH)"-"$OPTARG
|
||||||
;;
|
;;
|
||||||
o)
|
|
||||||
CONSENSUS_TYPE=$OPTARG
|
|
||||||
;;
|
|
||||||
a)
|
a)
|
||||||
CERTIFICATE_AUTHORITIES=true
|
CERTIFICATE_AUTHORITIES=true
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -220,8 +220,7 @@ Application: &ApplicationDefaults
|
||||||
Orderer: &OrdererDefaults
|
Orderer: &OrdererDefaults
|
||||||
|
|
||||||
# Orderer Type: The orderer implementation to start
|
# Orderer Type: The orderer implementation to start
|
||||||
# Available types are "solo" and "etcdraft"
|
OrdererType: etcdraft
|
||||||
OrdererType: solo
|
|
||||||
|
|
||||||
Addresses:
|
Addresses:
|
||||||
- orderer.example.com:7050
|
- orderer.example.com:7050
|
||||||
|
|
@ -309,19 +308,6 @@ Channel: &ChannelDefaults
|
||||||
################################################################################
|
################################################################################
|
||||||
Profiles:
|
Profiles:
|
||||||
|
|
||||||
TwoOrgsOrdererGenesis:
|
|
||||||
<<: *ChannelDefaults
|
|
||||||
Orderer:
|
|
||||||
<<: *OrdererDefaults
|
|
||||||
Organizations:
|
|
||||||
- *OrdererOrg
|
|
||||||
Capabilities:
|
|
||||||
<<: *OrdererCapabilities
|
|
||||||
Consortiums:
|
|
||||||
SampleConsortium:
|
|
||||||
Organizations:
|
|
||||||
- *Org1
|
|
||||||
- *Org2
|
|
||||||
TwoOrgsChannel:
|
TwoOrgsChannel:
|
||||||
Consortium: SampleConsortium
|
Consortium: SampleConsortium
|
||||||
<<: *ChannelDefaults
|
<<: *ChannelDefaults
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue