指定的查询不存在

时间:2018-05-19 14:19:59

标签: hyperledger-fabric hyperledger hyperledger-composer

我正在使用以下设置在Hyperledger中执行交易:

namespace com.emastersapp


/**
 * Cashier participant identified by userId
 */
participant Cashier identified by userId {
  o String userId
}

queries.qry:

query getCashierByUserId {
  description: "Get Cashier by UserId"
  statement:
      SELECT com.emastersapp.Cashier
          WHERE (userId == _$userId)
}

在logic.js中,我有一个调用函数:

 let results = await query('getCashierByUserId', { userId: resource.userId });

但是在运行事务时我遇到了这个错误:

"Error trying invoke business network. Error: No valid responses from any peers.\nResponse from attempted peer comms was an error: Error: 2 UNKNOWN: error executing chaincode: transaction returned with failure: Error: The specified query does not exist"

1 个答案:

答案 0 :(得分:0)

从上面假设查询在查询中应该在queries.qry文件中。

由于