无法从超级边界区块链中部署的合同中读取值

时间:2016-08-08 10:43:51

标签: blockchain hyperledger

我已在本地设置了超级边界区块链。我在docker容器中运行hyperledger bc服务。我能够成功启动节点,能够使用sample contract部署和写入bc。

但无法从区块链中读回数据。以下是bc抛出的错误消息。任何人都可以指导这里的错误吗?

$.methodName();

我使用IBM Blockchain JS与go合同进行交互。 下面是节点js代码

    [ibc-js] Deploy Chaincode - Complete
{"query":{},"invoke":{},"details":{"deployed_name":"c123c14a65a511ee79e2a41b23726f473478d002064c01c3ce035cffa1229af083d73f1db220fc2f267b9ae31d66ce2e10113548e7abdf8812986ac3c5770a9c","func":{"invoke":["init","write"],"query":["read"]},"git_url":"https://github.com/IBM-Blockchain/learn-chaincode/finished","options":{"quiet":true,"timeout":60000,"tls":false},"peers":[{"name":"vp0-vp0...:49155","api_host":"127.0.0.1","api_port":49155,"id":"vp0","tls":false}],"timestamp":1470146338831,"users":[],"unzip_dir":"learn-chaincode-master/finished","version":"github.com/hyperledger/fabric/core/chaincode/shim","zip_url":"https://github.com/IBM-Blockchain/learn-chaincode/archive/master.zip"}}
sdk has deployed code and waited
[ibc-js] write  - success: { jsonrpc: '2.0',
  result:
   { status: 'OK',
     message: '8b340e92-f96f-41f6-9b15-6ccb23304360' },
  id: 1470146405598 }
write response: { jsonrpc: '2.0',
  result:
   { status: 'OK',
     message: '8b340e92-f96f-41f6-9b15-6ccb23304360' },
  id: 1470146405598 }
    [ibc-js] read  - success: { jsonrpc: '2.0',
      error:
       { code: -32003,
         message: 'Query failure',
         data: 'Error when querying chaincode: Error:Failed to launch chaincode spec(Could not get deployment transaction for c123c14a65a511ee79e2xxxxxxxxxxxxxxxxe7abdf8812986ac3c5770a9c - LedgerError - ResourceNotFound: ledger: resource not found)' },
      id: 1470146405668 }
    read response: null { name: 'query() resp error',
      code: 400,
      details:
       { code: -32003,
         message: 'Query failure',
         data: 'Error when querying chaincode: Error:Failed to launch chaincode spec(Could not get deployment transaction for c123c14a65a511ee79e2xxxxxxxxxxxxxxxxe7abdf8812986ac3c5770a9c - LedgerError - ResourceNotFound: ledger: resource not found)' } }

0 个答案:

没有答案