Failed to register: Error: fabric-ca request register failed with errors [[{"code":0,"message":"No i...

I try to run sample application as stated here :  http://hyperledger-fabric.readthedocs.io/en/release/write_first_app.html

Everything looks good until I ran this command : node registerUser

Error :

Store path:/Users/johndoe/Desktop/myProject/fabric-samples/fabcar/hfc-key-store Successfully loaded admin from persistence Failed to register: Error: fabric-ca request register failed with errors [[{"code":0,"message":"No identity type provided. Please provide identity type"}]]

I checked logs by running docker logs ca.example.com command:

2017/11/08 09:43:07 [DEBUG] Successful authentication of 'admin'

2017/11/08 09:43:07 [DEBUG] Register request received

2017/11/08 09:43:07 [DEBUG] Received registration request from admin: &{RegistrationRequest:{Name:user1 Type: Secret:<> MaxEnrollments:1 Affiliation:org1.department1 Attributes:[] CAName:}}

2017/11/08 09:43:07 [DEBUG] Registration of 'user1' failed: No identity type provided. Please provide identity type

2017/11/08 09:43:07 [INFO] 172.18.0.1:60190 - "POST /api/v1/register" 0

解决方案:

在 fabcar/registerUser.js 文件修改第56行:

-    return fabric_ca_client.register({enrollmentID: 'user1', affiliation: 'org1.department1'}, admin_user);
+    return fabric_ca_client.register({enrollmentID: 'user1', affiliation: 'org1.department1',role: 'client'}, admin_user);

  

 

Did I miss anything here? I successfully ran node enrollAdmin.js and able to get the generated eCert & key material in hfc-key-store

In my case, adding the user's role type make it works.

return fabric_ca_client.register({enrollmentID: 'user1', affiliation: 'org1.department1',role: 'client'}, admin_user);
 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值