Fix: Support Channel-Specific Chaincode Directories to Prevent Duplicate Docker Mounts
Fix: updated fablo.sh to support channel-name/chaincode-name directory structure for Docker mounts
- Modify
executeOnFabloDockerfunction to dynamically create Docker volume mounts for each chaincode based on the channel-name/chaincode-name directory structure. - This change resolves the issue of duplicate Docker mount errors when multiple chaincodes are defined for the same network.
Fixes: #346 #228
@dzikowski Kindly review the PR
The proposed solution does not solve the issue. The actual error is not about mounting additional volumes for Fablo container. It is about mounting names in Docker Compose file for Fabric CLI container. Have a look at this Docker Compose template: https://github.com/hyperledger-labs/fablo/blob/main/src/setup-docker/templates/fabric-docker/docker-compose.yaml#L102
<%_ chaincodes.forEach(function(chaincode) { _%>
- "$CHAINCODES_BASE_DIR/<%= chaincode.directory %>/:/var/hyperledger/cli/<%= chaincode.name %>/"
Instead of target directory pattern /var/hyperledger/cli/<chaincode-name>, we want to have /var/hyperledger/cli/<channel-name>-<chaincode-name>, or /var/hyperledger/cli/<channel-name>/<chaincode-name>.
Then we need to ensure everything works - probably enough is running locally e2e-network/docker scripts.