Skip to content
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

Unable to edit chaincode #1

Open
xinhan1989 opened this issue Apr 12, 2016 · 3 comments
Open

Unable to edit chaincode #1

xinhan1989 opened this issue Apr 12, 2016 · 3 comments

Comments

@xinhan1989
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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 [email protected] 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants