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

How to add a new attribute ? #199

Open
manasabingi opened this issue Mar 28, 2018 · 4 comments
Open

How to add a new attribute ? #199

manasabingi opened this issue Mar 28, 2018 · 4 comments

Comments

@manasabingi
Copy link

As per my requirement i need to add a new attribute in application. I made changes in marbles.go , write_ledger.go , read_ledger.go, helper.js, app.js,marbles_cc_lib.js, websocket_server_side.js these files . But still i am facing errors. Can anyone help me to add an attribute.
marbles_erroe

@dshuffma-ibm
Copy link
Contributor

likely going to need your chaincode posted here, you can zip it up and drop it in a comment.

based on your error of Incorrect number of arguments. Expecting 3 you likely need to change the number of arguments the chaincode is expecting. i'm guessing you are sending more (b/c you added a field). well the chaincode looks at the number of arguments, so change write_ledger.go to match.

if len(args) != 3 {        //<- depending on what you did, this might need to change
	return shim.Error("Incorrect number of arguments. Expecting 3")
}

@dshuffma-ibm
Copy link
Contributor

also you can/should print things out in your chaincode code. then you can check the chaincode logs to verify you are getting what you meant to send.

@bingimanasa
Copy link

marbles.tar.gz
This is my chaincode. I have changed the number of arguments . But still getting same error.

@dshuffma-ibm
Copy link
Contributor

did you ever figure it out? You should print out the arguments the chaincode is getting. It apparently is not getting the expected number of arguments (since that's the error...). If you log it, you should see which one is missing, and track that back in your JS.

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

3 participants