Fabric reported an error when calling the chaincode:
Error: chaincode argument error: json: cannot unmarshal number into Go struct field .Args of type string
or
Error: chaincode argument error: json: cannot unmarshal bool into Go struct field .Args of type string
The data has string , boolean , floating point and integer types in the structure , as shown below:
The instruction called is
Mainly look at the parameter passing place, and pass the parameters according to the data type in the structure. There are no double quotes for integer , boolean and floating - point data, but an error is reported when calling
The solution is to add double quotation marks to all the parameters when calling, this method will not change the data type, can key
be verified according to the query after the call
Successfully solved: chaincode argument error: json: cannot unmarshal xxx into Go struct field .Args of type string
the problem
Welcome friends to discuss, if you have any errors, please comment in the comment area or send a private chat message, thank you.