Closed augustinep closed 7 years ago
Forgot to add, the parameters that I am passing for Invoke and Query are given below: { "jsonrpc": "2.0", "method": "invoke", "params": { "type": 1, "chaincodeID": {
"name": "67e573465afaf6fab0a0f00661def455e339c45630da66eacb61dc94c018821dfb0dd1f414c4d539f52e2442df991b5e7416233aa7cafddd433d287d01e668db"
},
"ctorMsg": {
"function": "createProduct",
"args": [
"P001","LG D410", "user_type1_0"
]
},
"secureContext": "user_type1_0"
}, "id": 1 }
{ "jsonrpc": "2.0", "method": "query", "params": { "type": 1, "chaincodeID": { "name”: "67e573465afaf6fab0a0f00661def455e339c45630da66eacb61dc94c018821dfb0dd1f414c4d539f52e2442df991b5e7416233aa7cafddd433d287d01e668db" }, "ctorMsg": { "function": "getProduct", "args": [ "P001" ] }, "secureContext": "user_type1_0" }, "id": 1 }
The issue seems to be with special characters. I can't make out any visible difference (apart from the new chaincode ID), but this worked after I copied the template in Bluemix and replaced the parameters.
{ "jsonrpc": "2.0", "method": "query", "params": { "type": 1, "chaincodeID": { "name": "8b9b5c6791c2f1fd1b9a0864988368cad005ed4aa1fbca40449ef3f9aa70ffd9c22b1fdf4cc43ba4e03369f3e2e1939fe998c8d04d83090f1f75405bedd410a3" }, "ctorMsg": { "function": "getProducts", "args": [ "P001" ] }, "secureContext": "user_type1_0" }, "id": 1 }
Hi,
I was able to get successful response, while deploy and invoking the operations in chaincode. I could see the block height increment after each operation.
However, when I use the Query operation to retrieve the data, I am getting the following error: { "jsonrpc": "2.0", "error": { "code": -32700, "message": "Parse error", "data": "Error unmarshalling chaincode request payload: invalid character '6' after object key" }, "id": null }
The character ('6' in this case) keeps changing with new deployment and as per my observation, it is the first character of the chaincode ID.
The chain code is available at: https://github.com/augustinep/online-retail