尚未指定名片

时间:2018-08-01 05:29:49

标签: hyperledger-fabric hyperledger hyperledger-composer

我一直在开发Hyperledger Composer Chaincode。我需要开发的功能之一是启用多用户并验证作曲家休息服务器。我通过命令行创建了一个与以下示例代码相同的参与者:

composer identity issue --card admin@tutorial-network -f usr001@tutorial-network.card -u usr001 -a "resource:org.acme.biznet.Trader#usr001" -x true

该行的输出是用于身份的.card文件。然后我通过调用api / wallet / import的POST请求成功导入了钱包卡。但是,在对用户进行身份验证后,我创建的响应如下:

{"error":{"statusCode":500,"name":"Error","message":"A business network card has not been specified","stack":"Error: A business network card has not been specified\

我从堆栈溢出中发现了这篇文章,它说只有在作曲家没有持久数据源时才会发生: Hyperledger Composer Error Identity has not been registered once issued

在我们的案例中,我们将cloudant用作数据库,所以我不知道自己在做什么错。以下是我对COMPOSER_DATASOURCES的配置:

COMPOSER_DATASOURCES='{
  "db": {
    "name": "db",
    "connector": "cloudant",
    "username": "myusername",
    "password": "mypassword",
    "host": "myhost",
    "port": 443,
    "url": "myurl",
    "database": "composer-wallets"
  }
}'

2 个答案:

答案 0 :(得分:0)

您是否已将卡导入钱包?

composer card import -f <The card file name>

查看详情https://hyperledger.github.io/composer/latest/managing/identity-issue

答案 1 :(得分:0)

可能是您正在使用composer-rest-server的损坏版本。我在将20.2升级到20.7时遇到了同样的问题-可以正常工作