Skip to content

Commit 6e03b70

Browse files
committed
[FAB-3025] Update ledger defaults for orderer
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 <[email protected]>
1 parent a97886a commit 6e03b70

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

orderer/localconfig/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ type SbftShared struct {
153153

154154
var defaults = TopLevel{
155155
General: General{
156-
LedgerType: "ram",
156+
LedgerType: "file",
157157
ListenAddress: "127.0.0.1",
158158
ListenPort: 7050,
159159
GenesisMethod: "provisional",
@@ -172,7 +172,7 @@ var defaults = TopLevel{
172172
HistorySize: 10000,
173173
},
174174
FileLedger: FileLedger{
175-
Location: "",
175+
Location: "/var/hyperledger/production/orderer",
176176
Prefix: "hyperledger-fabric-ordererledger",
177177
},
178178
Kafka: Kafka{

orderer/network_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ func generateConfigEnv(peerNum uint64, grpcPort int, peerCommPort string, certFi
317317
tempDir, err := ioutil.TempDir("", "sbft_test_config")
318318
panicOnError(err)
319319
envs := []string{}
320+
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LEDGERTYPE=%s", "ram"))
320321
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LOCALMSPDIR=%s", ordererDir+"/../sampleconfig/msp"))
321322
envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LISTENPORT=%d", grpcPort))
322323
envs = append(envs, fmt.Sprintf("CONFIGTX_ORDERER_ORDERERTYPE=%s", "sbft"))

sampleconfig/orderer.yaml

+14-15
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ General:
1414
# - json: A simple file ledger that writes blocks to disk in JSON format.
1515
# Only one production ledger type is provided:
1616
# - file: A production file-based ledger.
17-
LedgerType: ram
17+
LedgerType: file
1818

1919
# Listen address: The IP on which to bind to listen.
2020
ListenAddress: 127.0.0.1
@@ -83,19 +83,6 @@ General:
8383
FileKeyStore:
8484
KeyStore:
8585

86-
################################################################################
87-
#
88-
# SECTION: RAM Ledger
89-
#
90-
# - This section applies to the configuration of the RAM ledger.
91-
#
92-
################################################################################
93-
RAMLedger:
94-
95-
# History Size: The number of blocks that the RAM ledger is set to retain.
96-
HistorySize: 1000
97-
98-
9986
################################################################################
10087
#
10188
# SECTION: File Ledger
@@ -108,12 +95,24 @@ FileLedger:
10895
# Location: The directory to store the blocks in.
10996
# NOTE: If this is unset, a temporary location will be chosen using
11097
# the prefix specified by Prefix.
111-
Location:
98+
Location: /var/hyperledger/production/orderer
11299

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

104+
################################################################################
105+
#
106+
# SECTION: RAM Ledger
107+
#
108+
# - This section applies to the configuration of the RAM ledger.
109+
#
110+
################################################################################
111+
RAMLedger:
112+
113+
# History Size: The number of blocks that the RAM ledger is set to retain.
114+
HistorySize: 1000
115+
117116
################################################################################
118117
#
119118
# SECTION: Kafka

0 commit comments

Comments
 (0)