IBM-Blockchain-Archive / cp-chaincode-v2

Updated commercial paper chaincode. Separated for backwards compatibility.
Apache License 2.0
3 stars 32 forks source link

Unable to edit chaincode #1

Open xinhan1989 opened 8 years ago

xinhan1989 commented 8 years ago

Sorry I'm unsure if this is the correct place to ask this question. I've been having trouble changing the chaincode and re using it with the cp-web app on Bluemix. The error I constantly get is:

2016-04-12T09:11:38.312+1000[App/0]OUT[ibc-js] Deploying Chaincode - Starting 2016-04-12T09:11:39.356+1000[App/0]OUT! looks like a deploy error, holding off on the starting the socket 2016-04-12T09:11:39.356+1000[App/0]OUT[ibc-js] deploy - failure: 400 2016-04-12T09:11:39.357+1000[App/0]OUT details: { Error: 'Error getting chaincode package bytes: Error generating hashcode: Error getting code process done with error = exit status 1' } }

These are the steps I follow: Download code Make Change at line 288: owner.Quantity = cp.Qty to owner.Quantity = 100.0 upload code to a github and then replace the zip file within app.js to my new git

Any idea of what could trigger the error? If this is the wrong place I'll move the question to the cp-web application instead.

Cheers, William

masterDev1985 commented 8 years ago

I assume your talking about the code located here. The chaincode looks good! I suspect one of the parameters for configuring the chaincode in app.js is wrong. Could you please verify that your chaincode configuration looks like this:

chaincode: { zip_url: 'https://github.com/xinhan1989/ziptest/archive/test.zip', unzip_dir: 'ziptest-test', git_url: 'https://github.com/xinhan1989/ziptest' }

xinhan1989 commented 8 years ago

Yup, that's the code I'm talking about. the app.js does indeed look exactly like that, would there be anything else I'd need to add to it? From the logs I can see that the chaincode gets downloaded, unzipped and can read the files (I can see logs like [ibc-js] Found cc invoke function: createAccounts). but when it gets to the deploy function in the ibc it seems to simply suddenly produce the error I mentioned at the top. Currently reading through the IBM blockchain code to see if I can pinpoint where the error is generated but having trouble.

thanks for the help by the way!

Cheers, William

xinhan1989 commented 8 years ago

Hi Gari,

I've tried using integers as well, but still the same problem. I doubt it is the chain code itself as simply using the exact chain code but from a different github gives me this error.

Cheers, William Lau

On Apr 12, 2016, at 10:01 PM, Gari Singh notifications@github.com wrote:

@xinhan1989 - the error is most likely caused by the fact your chaincode does not exactly compile. I believe that owner.Quantity is actually typed as an integer not a float. Go does not do implicit type conversions. Can you try changing owner.Quantity = 100.0 to owner.Quantity = 100

― You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub