Add Chaincode Invoke Demo
Currently there is no invoke function for chaincode. Adding this would be helpful for demonstration and testing purposes.
Hi @YoungHypo,
I'm excited to reach out regarding the chaincode invoke functionality for Cello! I noticed this feature is currently assigned to you, and I wanted to express my enthusiasm about potentially contributing to this important component.
Having spent considerable time exploring Cello's architecture and setting up my local development environment, I've become particularly passionate about enhancing the chaincode management capabilities. The invoke function seems like a perfect feature to implement next, as it would significantly improve the demonstration and testing workflow for users.
I've already mapped out an implementation plan:
-
Backend Implementation:
- Add a dedicated
/api/v1/chaincodes/invokeendpoint in ChainCodeViewSet - Create robust serializers for parameter validation
- Implement the invoke method leveraging the existing PeerChainCode library
- Add a dedicated
-
Frontend Implementation:
- Extend the chaincode service with invoke functionality
- Update the model to handle these new actions
- Design an intuitive InvokeForm component with dynamic argument fields
- Add an accessible "Invoke" button to the chaincode dashboard
I'm ready to jump right in and would be thrilled to contribute this feature to the project! If you're open to collaboration on this, I'd welcome any guidance or specific requirements you might have. I'm committed to following the project's coding standards and architectural patterns.
Looking forward to your thoughts...
Hi @YoungHypo,
I'm excited to reach out regarding the chaincode invoke functionality for Cello! I noticed this feature is currently assigned to you, and I wanted to express my enthusiasm about potentially contributing to this important component.
Having spent considerable time exploring Cello's architecture and setting up my local development environment, I've become particularly passionate about enhancing the chaincode management capabilities. The invoke function seems like a perfect feature to implement next, as it would significantly improve the demonstration and testing workflow for users.
I've already mapped out an implementation plan:
Backend Implementation:
- Add a dedicated
/api/v1/chaincodes/invokeendpoint in ChainCodeViewSet- Create robust serializers for parameter validation
- Implement the invoke method leveraging the existing PeerChainCode library
Frontend Implementation:
- Extend the chaincode service with invoke functionality
- Update the model to handle these new actions
- Design an intuitive InvokeForm component with dynamic argument fields
- Add an accessible "Invoke" button to the chaincode dashboard
I'm ready to jump right in and would be thrilled to contribute this feature to the project! If you're open to collaboration on this, I'd welcome any guidance or specific requirements you might have. I'm committed to following the project's coding standards and architectural patterns.
Looking forward to your thoughts...
Very good proposal. However, the previous steps for chaincode approval and commitment are still in progress, so the chaincode invoke operation cannot be tested yet. @sangwaboi
I've analyzed the chaincode workflow and the issues in PR #671 and would like to help in fixing them to make the full chaincode lifecycle work properly. Here are the specific fixes I'm proposing:
-
Fix missing orderer_url in ChainCodeApproveForMyOrgBody serializer:
- Add orderer_url field to this serializer to match what the API endpoint expects
-
Implement init_flag functionality:
- Add init_flag field to serializer
- Modify the lifecycle_approve_for_my_org method to use this flag when constructing the command
- Fix the command construction in the backend to make --init-required conditional
-
Fixing soime command syntax and parameter naming inconsistency - ("sequency" vs "sequence") error's
-
Improving overall error handling:
- Add better error messages for debugging the approve and commit operations
I've already validated that these issues are preventing us from the proper functioning of the approve and commit operation's, which are prerequisites for the chaincode invoke functionality here.
If you agree with this approach, I'll submit a PR addressing these issues specifically. I'm passionate about getting the complete chaincode lifecycle working and believe these fixes will help move the project forward.
I’m currently working on chaincode approval. The chaincode commit hasn’t started yet, feel free to try it if you’d like. @sangwaboi