Skip to content

Commit

Permalink
[FAB-16132] Remove Kafka consensus from BYFN
Browse files Browse the repository at this point in the history
Remove Kafka as a consensus mechanism option
in BYFN, including all related configuration.

Users wishing to configure Kafka (not best
practice) in Fabric v2.0 can consult the
Fabric v1.4 and earlier samples.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I3bbffc876a6b64831cb6b2bdfac28a88cc013bdf
  • Loading branch information
Simon Stone committed Aug 8, 2019
1 parent 3996db5 commit b62d5bd
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 100 deletions.
2 changes: 1 addition & 1 deletion ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FAB_IMAGES_LIST=ca peer orderer ccenv tools baseos nodeenv javaenv
# Set fabric if you would like pull only fabric binaries
FAB_BINARY_REPO=fabric fabric-ca
# Pull below list of images from Hyperledger DockerHub
FAB_THIRDPARTY_IMAGES_LIST=kafka zookeeper couchdb
FAB_THIRDPARTY_IMAGES_LIST=couchdb
# Pull latest binaries of latest commit of release-1.4 from nexus snapshots
# Applicable only when set IMAGE_SOURCE to "nexus"
FAB_BINARY_VER=latest
Expand Down
2 changes: 0 additions & 2 deletions first-network/base/peer-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ services:
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
Expand Down
23 changes: 4 additions & 19 deletions first-network/byfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function printHelp() {
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), kafka, or etcdraft"
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 " -a - launch certificate authorities (no certificate authorities are launched by default)"
echo " -n - do not deploy chaincode (abstore chaincode is deployed by default)"
Expand Down Expand Up @@ -164,9 +164,7 @@ function networkUp() {
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)
fi
if [ "${CONSENSUS_TYPE}" == "kafka" ]; then
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_KAFKA}"
elif [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
fi
if [ "${IF_COUCHDB}" == "couchdb" ]; then
Expand All @@ -179,12 +177,6 @@ function networkUp() {
exit 1
fi

if [ "$CONSENSUS_TYPE" == "kafka" ]; then
sleep 1
echo "Sleeping 10s to allow $CONSENSUS_TYPE cluster to complete booting"
sleep 9
fi

if [ "$CONSENSUS_TYPE" == "etcdraft" ]; then
sleep 1
echo "Sleeping 15s to allow $CONSENSUS_TYPE cluster to complete booting"
Expand Down Expand Up @@ -222,9 +214,7 @@ function upgradeNetwork() {
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)
fi
if [ "${CONSENSUS_TYPE}" == "kafka" ]; then
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_KAFKA}"
elif [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
fi
if [ "${IF_COUCHDB}" == "couchdb" ]; then
Expand Down Expand Up @@ -274,8 +264,7 @@ function upgradeNetwork() {
# Tear down running network
function networkDown() {
# stop org3 containers also in addition to org1 and org2, in case we were running sample to add org3
# stop kafka and zookeeper containers in case we're running with kafka consensus-type
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_KAFKA -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_CA -f $COMPOSE_FILE_ORG3 down --volumes --remove-orphans
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_CA -f $COMPOSE_FILE_ORG3 down --volumes --remove-orphans

# Don't remove the generated artifacts -- note, the ledgers are always removed
if [ "$MODE" != "restart" ]; then
Expand Down Expand Up @@ -425,8 +414,6 @@ function generateChannelArtifacts() {
set -x
if [ "$CONSENSUS_TYPE" == "solo" ]; then
configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
elif [ "$CONSENSUS_TYPE" == "kafka" ]; then
configtxgen -profile SampleDevModeKafka -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
Expand Down Expand Up @@ -495,8 +482,6 @@ COMPOSE_FILE=docker-compose-cli.yaml
COMPOSE_FILE_COUCH=docker-compose-couch.yaml
# org3 docker compose file
COMPOSE_FILE_ORG3=docker-compose-org3.yaml
# kafka and zookeeper compose file
COMPOSE_FILE_KAFKA=docker-compose-kafka.yaml
# two additional etcd/raft orderers
COMPOSE_FILE_RAFT2=docker-compose-etcdraft2.yaml
# certificate authorities compose file
Expand Down
33 changes: 1 addition & 32 deletions first-network/configtx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Application: &ApplicationDefaults
Orderer: &OrdererDefaults

# Orderer Type: The orderer implementation to start
# Available types are "solo" and "kafka"
# Available types are "solo" and "etcdraft"
OrdererType: solo

Addresses:
Expand All @@ -244,12 +244,6 @@ Orderer: &OrdererDefaults
# max bytes will result in a batch larger than preferred max bytes.
PreferredMaxBytes: 512 KB

Kafka:
# Brokers: A list of Kafka brokers to which the orderer connects
# NOTE: Use IP:port notation
Brokers:
- 127.0.0.1:9092

# Organizations is the list of orgs which are defined as participants on
# the orderer side of the network
Organizations:
Expand Down Expand Up @@ -339,31 +333,6 @@ Profiles:
Capabilities:
<<: *ApplicationCapabilities

SampleDevModeKafka:
<<: *ChannelDefaults
Capabilities:
<<: *ChannelCapabilities
Orderer:
<<: *OrdererDefaults
OrdererType: kafka
Kafka:
Brokers:
- kafka.example.com:9092

Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Application:
<<: *ApplicationDefaults
Organizations:
- <<: *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *Org1
- *Org2

SampleMultiNodeEtcdRaft:
<<: *ChannelDefaults
Capabilities:
Expand Down
43 changes: 0 additions & 43 deletions first-network/docker-compose-kafka.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions first-network/eyfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function networkUp () {

# Tear down running network
function networkDown () {
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_KAFKA -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes --remove-orphans
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes --remove-orphans
# Don't remove containers, images, etc if restarting
if [ "$MODE" != "restart" ]; then
#Cleanup the chaincode containers
Expand Down Expand Up @@ -233,8 +233,6 @@ COMPOSE_FILE_COUCH=docker-compose-couch.yaml
COMPOSE_FILE_ORG3=docker-compose-org3.yaml
#
COMPOSE_FILE_COUCH_ORG3=docker-compose-couch-org3.yaml
# kafka and zookeeper compose file
COMPOSE_FILE_KAFKA=docker-compose-kafka.yaml
# two additional etcd/raft orderers
COMPOSE_FILE_RAFT2=docker-compose-etcdraft2.yaml
# use go as the default language for chaincode
Expand Down

0 comments on commit b62d5bd

Please sign in to comment.