我需要知道如何查詢以下的invoke(AC(123456A)或(user_type1_c19a5f0b7e)時,我有Init這:Bluemix blockchain:我如何查詢這個?
{
"jsonrpc": "2.0",
"method": "deploy",
"params": {
"type": 1,
"chaincodeID": {
"path": "https://github.com/johndoe/learn-chaincode/finished"
},
"ctorMsg": {
"function": "init",
"args": [
"hi there"
]
},
"secureContext": "user_type1_191b8c2993"
},
"id": 1
}
這裏是我的(成功)調用:
{
"jsonrpc": "2.0",
"method": "invoke",
"params": {
"type": 1,
"chaincodeID": {
"name": "b42b506c13fg1157520d585841a691f4b598d9aac53adc95277ed710c7f1f5aaa59a89a8dca8ddf3e46d5241562f3316956a04ad8a33181d30cb01b1c4c9adb2f"
},
"ctorMsg": {
"function": "AC(123456A)",
"args": [
"AcctId:949392949233 ","Year2015 Sem1 ", "IT1234:A ", " IT2345:B+ ", "IT3456:A ", "Year 2015 Sem2 ", "IT4567:B ", "IT5678: B", "IT5678:A ","Year 2016 Sem1 ", "IT6789:C ", "IT7890:C ", "Cumulative GPA: 3"
]
},
"secureContext": "user_type1_c19a5f0b7e"
},
"id": 4
}
這裏被查詢,我想,我不能得到我想要的結果:
{
"jsonrpc": "2.0",
"method": "query",
"params": {
"type": 1,
"chaincodeID": {
"name": "b42b506c13fg1157520d585841a691f4b598d9aac53adc95277ed710c7f1f5aaa59a89a8dca8ddf3e46d5241562f3316956a04ad8a33181d30cb01b1c4c9adb2f"
},
"ctorMsg": {
"function": "AC(123456A)",
"args": [
"AcctId:949392949233 "
]
},
"secureContext": "user_type1_c19a5f0b7e"
},
"id": 2
}
下面是用於查詢的響應
{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Query failure",
"data": "Error when querying chaincode: Error:Transaction or query returned with failure: Received unknown function query"
},
"id": 2
}
現在,我正在試用本教程,它由IBM Bluemix提供: https://github.com/IBM-Blockchain/learn-chaincode。
我試圖用他們的例如init和不調用(成功),以滿足我的需求。我嘗試了前面提到的Bluemix教程,並且能夠實現文檔中提到的內容。因此,我決定援引一些東西來滿足我自己的需求。但是,我無法查詢人AC(123456A)或user_type1_c19a5f0b7e,並顯示諸如「Year2015 Sem1」,「IT1234:A」,「IT3456:B +」等項目。我如何查詢(調用)以適應我自己的需求?