Skip to content

Commit

Permalink
[FAB-3025] Update ledger defaults for orderer
Browse files Browse the repository at this point in the history
The current defaults for the orderer have it:

1. Use the "ram" ledger
2. Set the "file" ledger's location to /tmp which means it won't persist
across restarts.

Both of these choices are unacceptable for a production environment.
This changesets sets the "file" ledger as the default and its location
to a path outside the /tmp dir, and inline with the peer's ledger.

Change-Id: I59413ceb45d0676d00fd2204e0bda9a659600dec
Signed-off-by: Kostas Christidis <kostas@christidis.io>
  • Loading branch information
kchristidis committed Apr 29, 2017
1 parent a97886a commit 6e03b70
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions orderer/localconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ type SbftShared struct {

var defaults = TopLevel{
General: General{
LedgerType: "ram",
LedgerType: "file",
ListenAddress: "127.0.0.1",
ListenPort: 7050,
GenesisMethod: "provisional",
Expand All @@ -172,7 +172,7 @@ var defaults = TopLevel{
HistorySize: 10000,
},
FileLedger: FileLedger{
Location: "",
Location: "/var/hyperledger/production/orderer",
Prefix: "hyperledger-fabric-ordererledger",
},
Kafka: Kafka{
Expand Down
1 change: 1 addition & 0 deletions orderer/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func generateConfigEnv(peerNum uint64, grpcPort int, peerCommPort string, certFi
tempDir, err := ioutil.TempDir("", "sbft_test_config")
panicOnError(err)
envs := []string{}
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LEDGERTYPE=%s", "ram"))
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LOCALMSPDIR=%s", ordererDir+"/../sampleconfig/msp"))
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LISTENPORT=%d", grpcPort))
envs = append(envs, fmt.Sprintf("CONFIGTX_ORDERER_ORDERERTYPE=%s", "sbft"))
Expand Down
29 changes: 14 additions & 15 deletions sampleconfig/orderer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ General:
# - json: A simple file ledger that writes blocks to disk in JSON format.
# Only one production ledger type is provided:
# - file: A production file-based ledger.
LedgerType: ram
LedgerType: file

# Listen address: The IP on which to bind to listen.
ListenAddress: 127.0.0.1
Expand Down Expand Up @@ -83,19 +83,6 @@ General:
FileKeyStore:
KeyStore:

################################################################################
#
# SECTION: RAM Ledger
#
# - This section applies to the configuration of the RAM ledger.
#
################################################################################
RAMLedger:

# History Size: The number of blocks that the RAM ledger is set to retain.
HistorySize: 1000


################################################################################
#
# SECTION: File Ledger
Expand All @@ -108,12 +95,24 @@ FileLedger:
# Location: The directory to store the blocks in.
# NOTE: If this is unset, a temporary location will be chosen using
# the prefix specified by Prefix.
Location:
Location: /var/hyperledger/production/orderer

# The prefix to use when generating a ledger directory in temporary space.
# Otherwise, this value is ignored.
Prefix: hyperledger-fabric-ordererledger

################################################################################
#
# SECTION: RAM Ledger
#
# - This section applies to the configuration of the RAM ledger.
#
################################################################################
RAMLedger:

# History Size: The number of blocks that the RAM ledger is set to retain.
HistorySize: 1000

################################################################################
#
# SECTION: Kafka
Expand Down

0 comments on commit 6e03b70

Please sign in to comment.