CouchDB index support for implicit collections
Allow CouchDB index creation on implicit collection of organisations.
Indexes can be created for specific organisation's implicit collections at:
META-INF/statedb/couchdb/collections/_implicit_org_<MSP_ID> directory of the chaincode package.
Common indexes for all the organisations' implicit collection can be created at:
META-INF/statedb/couchdb/collections/_implicit_org_* directory of the chaincode package.
( * acts as wildcard for all organisation MSP ids. )
Type of change
- New feature
Description
Updated chaincode deployment handler to check if the indexes are for implicit collection if given collection directory name not explicitly defined in collection config. If the implicit collection indexes belong this handling peer's organisation or passed as global implicit collection indexes (using * notation), then indexes are created on corresponding implicit collection.
Additional details
- Please review the way of fetching
localMspIddirectly usingviperatNewDBconstructor function. - Added few more tar file entries to represent implicit collection indexes in unit tests. (However UT
TestHandleChainCodeDeployOnCouchDBwas already failing due to some other error)
Related issues
- #4780
We'll want an integration test for both the single org use case and all org use case. It should be feasible to extend the existing CouchDB index integration test here: https://github.com/hyperledger/fabric/blob/main/integration/ledger/couchdb_indexes_test.go
Not many people use Windows for Fabric, but still, asterisk is not allowed in Windows directory names. Maybe use _implicit_all_orgs?