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的問題
歡迎小伙伴討論,如有錯誤請在評論區評論或發私聊訊息,謝謝你,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/231489.html
標籤:區塊鏈
