Skip to content

Commit

Permalink
Merge "[FAB-4185] remove sbft package"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Yellick authored and Gerrit Code Review committed Jun 1, 2017
2 parents 75294a9 + 53b1bb9 commit fa63fb9
Show file tree
Hide file tree
Showing 54 changed files with 4 additions and 7,924 deletions.
4 changes: 1 addition & 3 deletions common/configtx/tool/provisional/provisional.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ const (
ConsensusTypeSolo = "solo"
// ConsensusTypeKafka identifies the Kafka-based consensus implementation.
ConsensusTypeKafka = "kafka"
// ConsensusTypeSbft identifies the SBFT consensus implementation.
ConsensusTypeSbft = "sbft"

// TestChainID is the default value of ChainID. It is used by all testing
// networks. It it necessary to set and export this variable so that test
Expand Down Expand Up @@ -131,7 +129,7 @@ func New(conf *genesisconfig.Profile) Generator {
}

switch conf.Orderer.OrdererType {
case ConsensusTypeSolo, ConsensusTypeSbft:
case ConsensusTypeSolo:
case ConsensusTypeKafka:
bs.ordererGroups = append(bs.ordererGroups, config.TemplateKafkaBrokers(conf.Orderer.Kafka.Brokers))
default:
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/config/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ peer:
# SHA2 is hardcoded in several places, not only BCCSP
Hash: SHA2
Security: 256
# Location of Key Store, can be subdirectory of SbftLocal.DataDir
# Location of Key Store
FileKeyStore:
# If "", defaults to 'mspConfigPath'/keystore
# TODO: Ensure this is read with fabric/core/config.GetPath() once ready
Expand Down
46 changes: 0 additions & 46 deletions examples/cluster/config/orderer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,49 +159,3 @@ Kafka:
# certificates from the Kafka cluster.
RootCAs:
#File: uncomment to read Certificate from a file

################################################################################
#
# SECTION: SBFT Local
#
# - This section applies to the configuration of the SBFT-based orderer.
#
################################################################################
SbftLocal:

# Address to use for SBFT internal communication
PeerCommAddr: ":6101"
CertFile: "sbft/testdata/cert1.pem"
KeyFile: "sbft/testdata/key.pem"
# Directory for SBFT data (persistence)
DataDir: "/tmp"

################################################################################
#
# SECTION: Genesis
#
# - This section is pending removal but is left to support SBFT
# to be migrated to configtx.yaml.
#
################################################################################
Genesis:

# Deprecated Batch Timeout: The amount of time to wait before creating a
# batch.
DeprecatedBatchTimeout: 10s

# DeprecatedBatchSize: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
DeprecatedBatchSize: 99 MB

# Defines the SBFT parameters when 'sbft' is specified as the 'OrdererType'
SbftShared:
# Number of peers
"N": 1
# Fault tolerance
F: 0
# Timeout of requests (seconds)
RequestTimeoutNsec: 1000000000
# Peers (PeerCommAddr) with the path of their cert
Peers:
":6101": "sbft/testdata/cert1.pem"
42 changes: 0 additions & 42 deletions orderer/localconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ type TopLevel struct {
FileLedger FileLedger
RAMLedger RAMLedger
Kafka Kafka
Genesis Genesis
SbftLocal SbftLocal
}

// General contains config which should be common among all orderer types.
Expand Down Expand Up @@ -125,32 +123,6 @@ type Retry struct {
Stop time.Duration
}

// Genesis is a deprecated structure which was used to put
// values into the genesis block, but this is now handled elsewhere.
// SBFT did not reference these values via the genesis block however
// so it is being left here for backwards compatibility purposes.
type Genesis struct {
DeprecatedBatchTimeout time.Duration
DeprecatedBatchSize uint32
SbftShared SbftShared
}

// SbftLocal contains configuration for the SBFT peer/replica.
type SbftLocal struct {
PeerCommAddr string
CertFile string
KeyFile string
DataDir string
}

// SbftShared contains config for the SBFT network.
type SbftShared struct {
N uint64
F uint64
RequestTimeoutNsec uint64
Peers map[string]string // Address to Cert mapping
}

var defaults = TopLevel{
General: General{
LedgerType: "file",
Expand Down Expand Up @@ -186,20 +158,6 @@ var defaults = TopLevel{
Enabled: false,
},
},
Genesis: Genesis{
SbftShared: SbftShared{
N: 1,
F: 0,
RequestTimeoutNsec: uint64(time.Second.Nanoseconds()),
Peers: map[string]string{":6101": "sbft/testdata/cert1.pem"},
},
},
SbftLocal: SbftLocal{
PeerCommAddr: ":6101",
CertFile: "sbft/testdata/cert1.pem",
KeyFile: "sbft/testdata/key.pem",
DataDir: "/tmp",
},
}

// Load parses the orderer.yaml file and environment, producing a struct suitable for config use
Expand Down
2 changes: 0 additions & 2 deletions orderer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/hyperledger/fabric/orderer/ledger"
"github.com/hyperledger/fabric/orderer/localconfig"
"github.com/hyperledger/fabric/orderer/multichain"
"github.com/hyperledger/fabric/orderer/sbft"
"github.com/hyperledger/fabric/orderer/solo"
cb "github.com/hyperledger/fabric/protos/common"
ab "github.com/hyperledger/fabric/protos/orderer"
Expand Down Expand Up @@ -194,7 +193,6 @@ func initializeMultiChainManager(conf *config.TopLevel, signer crypto.LocalSigne
consenters := make(map[string]multichain.Consenter)
consenters["solo"] = solo.New()
consenters["kafka"] = kafka.New(conf.Kafka.Version, conf.Kafka.Retry, conf.Kafka.TLS)
consenters["sbft"] = sbft.New(makeSbftConsensusConfig(conf), makeSbftStackConfig(conf))

return multichain.NewManagerImpl(lf, consenters, signer)
}
Loading

0 comments on commit fa63fb9

Please sign in to comment.