我試圖通過遵循Windows安裝程序在我的筆記本電腦上設置Hyperledger blocchain,能夠啓動docker映像並運行,但是當我嘗試部署提供的示例時,它總是拋出JSON輸入中的錯誤,如下所示。HyperLedger-Fabric ChainCode部署 - Base64錯誤
peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
響應:
[email protected]:~/go/$ docker exec -it aa413f4c4289 bash
[email protected]:/opt/gopath/src/github.com/hyperledger/fabric# peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
04:30:55.822 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'chaincode' Error: Non-empty JSON chaincode parameters must contain exactly 1 key: 'Args'
我在郵差試圖從主機:
得到的迴應作爲
{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error","data":"Error unmarshalling chaincode request payload: illegal base64 data at input byte 0"},"
這類似於錯誤消息我無法解決這個問題l,根據建議創建一個新帖子,請幫我解決這個問題。
Similar issue reported but that also doesn't answer
非常感謝謝爾蓋!,它的工作的罰款。下面是實際的代碼 '{ 「jsonrpc」: 「2.0」, 「方法」: 「部署」, 「PARAMS」:{ 「類型」:1, 「chaincodeID」:{ 「路徑」 :「github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02」 }, 「ctorMsg」:{ 「args」:[「aW5pdA ==」,「YQ ==」,「MTAwMA ==」 「YG ==」, 「MjAwMA ==」] } }, 「ID」:1 }' – Logumay
塞吉,我看到兩個格式支持: '{ 「功能」: 「初始化」, 「args」:[「a」,「1000」,「b」,「2000」]}}' as '{「args」:[「init」,「a」,「1000」,「b」,「2000」]}}' – Mil4n
@ Mil4n嗯,那是對的。它看起來像現在支持這兩種格式。只用「函數,參數」和「參數」進行了測試,兩個請求都被接受。謝謝你的信息。 –