我正在尝试使用以下过滤器执行Rest API
api/Commodity?filter={"where":{"owner":"resource:org.example.mynetwork.Trader%231"},%20"include":"resolve"}
但出现以下错误-
{"error":{"statusCode":500,"name":"Error","message":"2 UNKNOWN: error executing chaincode: transaction returned with failure: Error: ExecuteQuery not supported for leveldb","code":2,"metadata":{"_internal_repr":{}},"details":"error executing chaincode: transaction returned with failure: Error: ExecuteQuery not supported for leveldb","stack":"Error: 2 UNKNOWN: error executing chaincode: transaction returned with failure: Error: ExecuteQuery not supported for leveldb\n at new createStatusError (/home/composer/.npm-global/lib/node_modules/@ibmblockchain/composer-rest-server/node_modules/grpc/src/client.js:64:15)\n at /home/composer/.npm-global/lib/node_modules/@ibmblockchain/composer-rest-server/node_modules/grpc/src/client.js:583:15"}}
请提示这里出什么问题了?
答案 0 :(得分:0)
响应的重要部分在Error: ExecuteQuery not supported for leveldb
这表示您的结构已配置为使用内置的leveldb系统存储世界状态。因此,您无法对其执行任何类型的查询,并且其中包括其余过滤器。
您需要更改结构设置,以使用ouchdb作为世界状态存储。
可以在此处找到有关构建结构网络的结构文档,并且在此页面上有一个特定的部分,关于启用ouchdb。 参见https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html