无法将用户注册到添加到余额转移示例的新组织中 [英] Unable to enroll user in new org added to balance transfer sample

查看:78
本文介绍了无法将用户注册到添加到余额转移示例的新组织中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在跟踪来自此链接.我做了一些修改,现在我有3个单位,每个单位有1个对等方.一切顺利,直到我将用户注册到Org1和Org2为止,但是,当我尝试将用户注册到我的第3个组织时,出现以下错误

I am following Balance transfer from Hyperledger Fabric samples from this link. I have modified it a bit, now I have 3 Orgs with 1 Peer each. All goes fine till I enroll users to Org1 and Org2 but, when I try to enroll a user to my 3rd Org I get following error

无法获得注册用户:xyz,错误:错误:fabric-ca请求注册失败,错误[[{"code":63,"message":未能获得会员身份:sql:结果集中无行" }]]

Failed to get registered user: xyz with error: Error: fabric-ca request register failed with errors [[{"code":63,"message":"Failed to get Affiliation: sql: no rows in result set"}]]

我的Hyperledger Fabric二进制文件来自1.1.0 Alfa版本

My Binaries of Hyperledger Fabric are from version 1.1.0 Alfa

推荐答案

问题是样本中使用的fabric-ca不了解从属关系.默认情况下,fabric-ca仅具有以下隶属关系:

The issue is that the fabric-ca being used in the sample does not know about the affiliation. By default, fabric-ca only has the following affiliations:

org1.department1 org1.department2 org2.department1

org1.department1 org1.department2 org2.department1

代码在样本中注册并注册用户的用户将采用组织名称并将其与"department1"连接:

The code which registers and enrolls users in the sample takes the org name and concatenates it with "department1" :

let secret = await caClient.register({
                enrollmentID: username,
                affiliation: userOrg.toLowerCase() + '.department1'
            }, adminUserObj);

因此,当您传递Org3时,它将尝试向不存在的隶属关系org3.department1注册用户.

So when you pass in Org3, it tries to register the user with the affiliation org3.department1 which does not exist.

由于您使用的是1.1.0-alpha,因此很幸运,因为该版本的fabric-ca支持具有用于添加新的从属关系的API.最简单的方法是使用fabric-ca-client执行此操作:

Since you are using 1.1.0-alpha, you are in luck as this version of fabric-ca supports has an API for adding new affiliations. The easiest way is to use the fabric-ca-client to do this:

fabric-ca-client affiliation add org3
fabric-ca-client affiliation add org3.department1

您可以查看fabric-ca文档( http://hyperledger-fabric-ca.readthedocs .io/)以获取更多详细信息.您需要先使用fabric-ca-client注册一个密码为"adminpw"的管理员用户,然后运行上述命令.

You can look at the fabric-ca docs ( http://hyperledger-fabric-ca.readthedocs.io/ ) for more details. You'll need to first enroll the admin user which has the password "adminpw" with the fabric-ca-client and then run the above commands.

这篇关于无法将用户注册到添加到余额转移示例的新组织中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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