fablo icon indicating copy to clipboard operation
fablo copied to clipboard

feat: support installing chaincode from Docker image using CCAAS

Open dpereowei opened this issue 7 months ago • 3 comments

#429 link 429

This PR supports installing and running chaincode from a Docker image (CCaaS mode), rather than a local directory. It’s useful for teams who prefer building and deploying chaincode separately.

  • lang: "ccaas" is now supported in chaincode definitions
  • When lang is ccaas:
    • image and port are required
    • directory is optional
  • Lifecycle scripts were updated to handle packaging without source
  • Docker Compose now includes services for chaincodes running in CCaaS mode

Example config

{
    "name": "chaincode1",
    "version": "0.0.1",
    "lang": "ccaas",
    "channel": "my-channel1",
    "image": "realartisan/chaincode-kv-node:latest",
    "port": 7052
}



dpereowei avatar May 10 '25 17:05 dpereowei

@dpereowei that looks good, have you tested it locally? It would be good to make it as a part of one of pipelines. I think test-04-snapshot.sh is a good fit. The test can be reworked in a wollowing way:

  1. The config that is used there (fablo-config-hlf2-1org-1chaincode-raft-explorer.json), could have a chaincode docker image (ccaas) instead from a chaincode from source
  2. The test can build the chaincode docker image before starting the network

This test in CI would allow us to ensure it actually works, and how it behaves when tls is enabled (currently there is hardcoded false in chaincodePackage function).

Also an additional comment - I see you create the chaincode archive in /tmp. I think it's good to keep it in the current directory, or maybe in <pwd>/chaincodes subdirectory.

dzikowski avatar May 12 '25 09:05 dzikowski

Hi @dzikowski, I appreciate your feedback and I will get to working on the tests, thanks

dpereowei avatar May 12 '25 09:05 dpereowei

@dpereowei please squash these commits

umegbewe avatar Jun 10 '25 12:06 umegbewe

handled in #594

dzikowski avatar Aug 22 '25 08:08 dzikowski