Install chaincode from docker image
Right now Fablo requires a path to chaincode directory. We can additionally support passing chaincode docker image.
I would find this feature very helpful. What all would need to be changed in-order to support it
Currently this is the place where we have functions handling chaincode lifecycle (build, install, approve and commit): fabric-docker/scripts/chaincode-functions-v2.sh.
And this is the place where we use the functions: fabric-docker/commands-generated/chaincode-install-v2.sh (it uses https://ejs.co/ template engine).
And this is how our current config looks like: src/types/FabloConfigJson.ts (look for: ChaincodeJson for chaincode config). Then it is normalized/extended to become src/types/FabloConfigExtended.ts, which is used in templates.
Now, the feature requires to allow the chaincode config fablo-config.json (so ChaincodeJson) to accept either directory?: string; (the current way) or image?: string; parameter (for Docker image). Then, Fablo should validate and pass it to FabloConfigExtended. Then, the template (chaincode-install-v2.sh) should decide whether to call installation from source or from the Docker image, and call relevant functions from chaincode-functions-v2.sh (it needs function to handle installing chaincode from Docker image).
For local testing/evaluation you can create your own fablo-config.json file, use fablo-build.sh script to rebuild Fablo locally from source, and use fablo.sh from source for executing methods.
Should the default option be to deploy the chain code as a caas image? It would make extending it out to the kubernetes version easier as the bevel fabric operators default way is to deploy it as caas
Yes, exactly. I think that's the best approach.
Hey @dzikowski working on it