IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.03k stars 979 forks source link

How to add a new attribute ? #199

Open manasabingi opened 6 years ago

manasabingi commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

dshuffma-ibm commented 5 years ago

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.