我收到奇怪的錯誤查詢API。如果我做[email protected]:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.foo.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/foo.com/orderers/orderer.foo.com/msp/tlss/tlsca.foo.com-cert.pem -C balance -n mycc -c '{"Args":["deposit","a", "10"]}'
Hyperledger REST請求
我得到正確的答案
2017-08-24 19:08:57.988 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP 2017-08-24 19:08:57.988 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity 2017-08-24 19:08:57.989 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc 2017-08-24 19:08:57.989 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc 2017-08-24 19:08:57.990 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A81070A6508031A0C08C9C8FCCC0510...0A076465706F7369740A01610A023130 2017-08-24 19:08:57.990 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 3DD0C365C4B78EFDACB28D44D2ACA9237CA30B58F85783C597302F145E646063 2017-08-24 19:08:57.994 UTC [msp/identity] Sign -> DEBU 007 Sign: plaintext: 0A81070A6508031A0C08C9C8FCCC0510...724C7D77E58B98A251A5E3991CE087BC 2017-08-24 19:08:57.994 UTC [msp/identity] Sign -> DEBU 008 Sign: digest: 56E1846030E5CC7DB5651C43F90EE2B6D0F851F33CFE62105CEF998A32902424 2017-08-24 19:08:57.995 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 009 ESCC invoke result: version:1 response:<status:200 message:"OK" payload:"\000\000\000\000\000\[email protected]" > payload:"\n \033N\260\275\314\252\001\331\261\322\305p\222B\362*\236\255\372-\372\351\326f\\\312K\030\2475\210\333\022V\n8\022\024\n\004lscc\022\014\n\n\n\004mycc\022\002\010\003\022 \n\004mycc\022\030\n\007\n\001a\022\002\010\004\032\r\n\001a\032\010\000\000\000\000\000\[email protected]\032\r\010\310\001\032\010\000\000\000\000\000\[email protected]\"\013\022\004mycc\032\0031.0" endorsement:<endorser:"\n\nFooMSP\022\353\005-----BEGIN -----\nMIICCzCCAbGgAwIBAgIRAO0nWiOZB55Sn+HOAKQnRBEwCgYIKoZIzj0EAwIwaTEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xFDASBgNVBAoTC3RocmlsbHMuY29tMRcwFQYDVQQDEw5jYS50aHJp\nbGxzLmNvbTAeFw0xNzA4MjQxODIxMzVaFw0yNzA4MjIxODIxMzVaMFYxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp\nc2NvMRowGAYDVQQDExFwZWVyMC50aHJpbGxzLmNvbTBZMBMGByqGSM49AgEGCCqG\nSM49AwEHA0IABD7X3plp7UuYtwOCcWmHGDqP9zxtmjkmpnHiVqUiQ4HSVHcm45pw\nrPdjCo/VqZjG0VzsxAVyuKRzB3zt44auOm6jTTBLMA4GA1UdDwEB/wQEAwIHgDAM\nBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAICvVajYijpc+pSVXubVX1Xenut8/D+cX\nUi0E+sHQ+qKhMAoGCCqGSM49BAMCA0gAMEUCIQCD2DtlkOUBFiR4168HejsHHLHc\n+3w6ByZ4jUoYvhYYqAIgOQAWTQdSvxyihSNwMj5UZEYEfKOErBtilPr8AX9ieCo=\n-----END -----\n" signature:"0D\002 \027M\316J\003\356\327\212\021a1\233\315\223\317Z8\020\302X\224\374&J\006%\253\375\3461l[\002 5\371\"c\221\355qJ\373\341\226\r\260+\203&rL}w\345\213\230\242Q\245\343\231\034\340\207\274" > 2017-08-24 19:08:57.995 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 00a Chaincode invoke successful. result: status:200 payload:"\000\000\000\000\000\[email protected]" 2017-08-24 19:08:57.995 UTC [main] main -> INFO 00b Exiting.....
但是,如果我這樣做curl -H "Content-Type: application/json" -X POST -d '{ "jsonrpc": "2.0", "method": "invoke", "params": {"type": 1,"chaincodeID":{"name":"mycc"},"ctorMsg": {"args":["get", "a"]},"secureContext": "foo" }, "id":5}' foo.com:7050/chaincode
我奇怪的字符,看起來像一個破碎的編碼。
不知道我是否有配置或實施錯誤。