0

我将此请求发送到超级账本的 REST API:

$ curl -X POST --header "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID":{ "path":"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" }, "ctorMsg": { "args":["init", "a", "1000", "b", "2000"] } }, "id": 1 }' localhost:7050/chaincode

这是我得到的错误信息:

{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error","data":"Error unmarshalling chaincode request payload: illegal base64 data at input byte 0"},"id":null}

然后,我在 rest_api.go 中添加了调试日志,以检查对等方收到的任何内容 在此处输入图像描述 并获得此日志:

16:03:46.323 [rest] ProcessChaincode -> DEBU 027 reqBody = { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID":{ "path":"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" }, "ctorMsg": { "args":["init", "a", "1000", "b", "2000"] } }, "id": 1 }
16:03:46.331 [rest] ProcessChaincode -> ERRO 028 Error unmarshalling chaincode request payload: illegal base64 data at input byte 0

收到的消息似乎与“rpcRequest”、“ChaincodeSpec”和“ChaincodeInput”的定义相匹配,我不明白为什么它一直向我抛出解组错误...... 在此处输入图像描述 在此处输入图像描述

4

0 回答 0