-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, database name supplied to couchDB uses the following naming convention: 1. channelDB: ChannelName_ 2. namespace/chaincodeDB: - ChannelName_Namespace 3. collectionDB: - ChannelName_Namespace$CollectionName As the length of CouchDB database name cannot be greater than 249 characters, this CR truncates the name on violation of characters limit. To avoid collision between dbNames due to truncation, sha256 hash of untruncated dbName is appended to the truncated dbName. Further, as upper case letters are not allowed in couchDB database naming convention, this CR replaces every upper case letter with a '$' (i.e., escape sequence) and the respective lower case letter. As a result of this CR, on non-violation of length limit, the following naming convention is used 1. channel DB – ChannelName_ 2. namespace/chaincode DB - ChannelName_Namespace 3. collection DB - ChannelName_Namespace$$CollectionName (note that the nsJoiner between namespace and collection has been changed to '$$' from '$' as this CR also use '$' as escape sequence for upper case letter). On violation of length limit, the following naming convention is used 1. channelDB: truncatedChannelName(<SHA256 hash of ChannelName>)_ 2. namespace/chaincodeDB: truncatedChannelName_truncatedNamespace( <SHA256 hash of ChannelName_Namespace>) 3. collectionDB: truncatedChannelName_truncatedNamespace$$ truncatedCollectionName(<SHA256 hash of ChannelName_Namespace$CollectionName>) Change-Id: If29d5197bccae095955481dc3fe92bec00b9965c Signed-off-by: senthil <cendhu@gmail.com>
- Loading branch information
Showing
5 changed files
with
225 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ import ( | |
) | ||
|
||
const ( | ||
nsJoiner = "$" | ||
nsJoiner = "$$" | ||
pvtDataPrefix = "p" | ||
hashDataPrefix = "h" | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters