• Failed to register: Error: fabric-ca request register failed with errors [[{"code":0,"message":"No identity type provided. Please provide identity type"}]]解决方案


    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);
    
     
  • 相关阅读:
    hdu 1426(DFS+坑爹的输入输出)
    hdu 1430(BFS+康托展开+映射+输出路径)
    hdu 1664(数论+同余搜索+记录路径)
    BestCoder Round #86 二,三题题解(尺取法)
    hdu 1226(同余搜索)
    poj 1426(同余搜索)
    poj 2251(同余)
    hdu 1044(bfs+dfs+剪枝)
    hdu 1455(DFS+好题+经典)
    安装centos7后不能联网
  • 原文地址:https://www.cnblogs.com/sddai/p/9388300.html
Copyright © 2020-2023  润新知