发行后未注册Hyperledger Composer错误身份 [英] Hyperledger Composer Error Identity has not been registered once issued

查看:72
本文介绍了发行后未注册Hyperledger Composer错误身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在关注教程,我能够完成它.我向现有参与者发出新的身份,并使用以下命令为该身份创建名片:

I have been following this Tutorial and I am able to complete it. I issue a new identity, to an existing participant and I create a business card for this identity with the following command:

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

然后,我通过POST /wallet/import导入该名片,并且能够调用不同的REST API操作.之后,我停止composer-rest-server,几分钟后,再次使用命令composer-rest-server -c admin@tutorial-network -m true -a true

Then, I import that business card via POST /wallet/import and I am able to call different REST API operations. After that, I stop the composer-rest-server and after a few minutes I start the composer-rest-server again with the command composer-rest-server -c admin@tutorial-network -m true -a true

然后,我使用配置的身份验证机制(在本例中为passport-github策略)对REST API进行身份验证,如果我尝试通过REST API调用一个操作,它将抛出A business network card has not been specified错误消息,然后导入前一个通过POST /wallet/import的名片得到应该正确的no content.

Then, I authenticate to the REST API using the configured authentication mechanism (in this case passport-github strategy) and if I try to call one operation fro REST API it throws a A business network card has not been specified error message, then I import the previous business card via POST /wallet/import getting a no content which is supposed to be correct.

最后,当我尝试调用另一个REST API操作时,出现以下错误:

Finally, when I try to call another REST API operation I get the following error:

{
  "error": {
"statusCode": 500,
"name": "Error",
"message": "Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity has not been registered: usr001)",
"stack": "Error: Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity has not been registered: usr001)\n    at _checkRuntimeVersions.then.catch (/home/username/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:679:34)\n    at <anonymous>"
  }
}

这是主要问题,我不知道为什么以前使用REST API调用某些操作无法识别我的身份.

This is the main issue, I don't know why my identity is not being recongized by the REST API if I used it previously to call some operations.

推荐答案

问题是此处显示的持久性之一-> https://hyperledger.github.io/composer/v0.16/integrating/deploying-the-rest-server.html

the problem is one of persistence as captured here -> https://hyperledger.github.io/composer/v0.16/integrating/enabling-multiuser.html and the link for persisting identities (ie instructions) is captured here -> https://hyperledger.github.io/composer/v0.16/integrating/deploying-the-rest-server.html

通过使用LoopBack连接器,所有用户信息都将保留在LoopBack数据源中.默认情况下,REST服务器使用LoopBack内存"连接器来保留用户信息,而这些信息在REST服务器终止时会丢失. REST服务器应配置有LoopBack连接器,该连接器将数据存储在高度可用的数据源(例如数据库)中.

All user information is persisted in a LoopBack data source by using a LoopBack connector. By default, the REST server uses the LoopBack "memory" connector to persist user information, which is lost when the REST server is terminated. The REST server should be configured with a LoopBack connector that stores data in a highly available data source, for example a database.

这篇关于发行后未注册Hyperledger Composer错误身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆