Skip to content

Commit 72c03f1

Browse files
Chris Elderdenyeart
Chris Elder
authored andcommitted
FAB-1764 CouchDB name to be consistent with chain ID
Motivation for this change: Database creation fails on CouchDB if chainid does not meet Couch DB database naming conventions Chainid becomes database name in CouchDB. CouchDB naming conventions: Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -,and / are allowed. Must begin with a letter. Therefore, we either need to adopt these same restrictions for chainid naming, or have a deterministic mapping of chainid to a valid (and unique) CouchDB database name. The chainid also becomes a directory on the peer file system for the block storage ledger. Therefore the character '/' must also be avoided. Change-Id: I0582e63b53e2afb5dee2009ede5f695775282b46 Signed-off-by: Chris Elder <[email protected]>
1 parent 6daec3f commit 72c03f1

File tree

4 files changed

+350
-196
lines changed

4 files changed

+350
-196
lines changed

core/ledger/kvledger/txmgmt/statedb/statecouchdb/statecouchdb.go

-6
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ func (provider *VersionedDBProvider) GetDBHandle(dbName string) (statedb.Version
6464
provider.mux.Lock()
6565
defer provider.mux.Unlock()
6666

67-
//TODO determine if couch db naming restrictions should apply to all ledger names
68-
//TODO enforce all naming rules
69-
// Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter.
70-
// For now, we'll just lowercase the name within the couch versioned db.
71-
dbName = strings.ToLower(dbName)
72-
7367
vdb := provider.databases[dbName]
7468
if vdb == nil {
7569
var err error

0 commit comments

Comments
 (0)