-
Notifications
You must be signed in to change notification settings - Fork 87
Add testing for Golang Chaincode #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Debayan Ghosh <[email protected]>
@kalio007 @dzikowski the e2e tests are failing due to test snapshots not matching which is due to using of golang in the the samples yaml file. It can be fixed by creating a new file or updating the snapshots but the main problem is that test-02-raft was was also failing when I checked it personally. It seems to a docker problem, on my system I got :
A simple golang chaincode for setting and getting a key with 1 org, 1 orderer and 1 channel was working fine without errors. Also regarding chaincode-kv-go, I mainly just followed the implementation of kv-node. |
Signed-off-by: Debayan Ghosh <[email protected]>
This is the result of test-02-raft in my repo, https://github.com/debayangg/fablo/actions/runs/14825376358/job/41617875740.
|
Yes, if I read action logs properly, it seems it requires Go in version 1.19 or higher. The chaincode is executed in a docker container, which uses the output of:
is:
So I think the solution is to update the Fabric version in relevant fablo config file. You may choose for instance the newest |
I've read also your comment on failing Java chaincode for the newest version: #99 (comment) Isn't it just a matter of upgrading Java library version?
Do you think Java library upgrade should be a separate issue? |
No I dont think so, I will update the jdk version and try again. I had an exam today so didn't get time till now. Overall it all seems to be a problem of incompatible versions. |
I went ahead and made the changes in the java fabric sdk, tried out different versions and also tried versions used in chaincode samples provided in the fabric samples, it seems that Java chaincode will also need to be updated. It will take some time on my part to read through Java chaincode and refactor it as simple automated refactors are not working. |
Perfect, thanks! |
I suggest doing the opposite: modify the sample chaincode so that it's compatible with older versions of Go. A Go module declares its target version in You can try updating the target version like this:
Another thing: when packaging Go chaincode, References: Note: Because the |
Addresses the Issue #99 .