fablo icon indicating copy to clipboard operation
fablo copied to clipboard

Install chaincode from docker image

Open dzikowski opened this issue 1 year ago • 5 comments

Right now Fablo requires a path to chaincode directory. We can additionally support passing chaincode docker image.

dzikowski avatar Jan 05 '24 11:01 dzikowski

I would find this feature very helpful. What all would need to be changed in-order to support it

Nova38 avatar Mar 15 '24 23:03 Nova38

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.

dzikowski avatar Mar 16 '24 07:03 dzikowski

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

Nova38 avatar Apr 02 '24 01:04 Nova38

Yes, exactly. I think that's the best approach.

dzikowski avatar Apr 02 '24 05:04 dzikowski

Hey @dzikowski working on it

Gmin2 avatar Apr 06 '24 21:04 Gmin2