fablo icon indicating copy to clipboard operation
fablo copied to clipboard

Fix: Support Channel-Specific Chaincode Directories to Prevent Duplicate Docker Mounts

Open SkySingh04 opened this issue 1 year ago • 2 comments

Fix: updated fablo.sh to support channel-name/chaincode-name directory structure for Docker mounts

  • Modify executeOnFabloDocker function 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

SkySingh04 avatar Jun 22 '24 12:06 SkySingh04

@dzikowski Kindly review the PR

SkySingh04 avatar Jun 22 '24 12:06 SkySingh04

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.

dzikowski avatar Jun 24 '24 17:06 dzikowski