Fabric在调用链码时候报错:
Error: chaincode argument error: json: cannot unmarshal number into Go struct field .Args of type string
或
Error: chaincode argument error: json: cannot unmarshal bool into Go struct field .Args of type string
数据在结构体中有字符串、布尔、浮点和整型,如下所示:
调用的指令是
主要看传参处,按照结构体中数据类型进行传参,整型、布尔和浮点型数据都没有双引号,但是调用时报错
解决方法是在调用时在所有参数处都加上双引号,此做法并不会改变数据类型,可以在调用后根据key
查询得以验证

成功解决:chaincode argument error: json: cannot unmarshal xxx into Go struct field .Args of type string
的问题
欢迎小伙伴讨论,如有错误请在评论区评论或发私聊消息,谢谢你。