Hyperledger架构网络SDK [[{{“代码”:56,“消息”:“身份删除已禁用”}]]]

问题描述

我使用 IBM Blockchain Platform 创建了一个示例项目。

我正在尝试使用认的管理员身份注销用户

identityService.delete(userName,adminIdentity,true).then(function() {
     wallet.delete(userName);
});

我一直收到此错误


(node:48423) UnhandledPromiseRejectionWarning: Error: fabric-ca request identities/gayelabouimaddelete?force=true Failed with errors [[{"code":56,"message":"Identity removal is disabled"}]]

尽管管理员帐户的hf.Revoker设置为true,hf.Registrar.Roles设置为“ *”:


"identities": [
            {
                "id": "admin","type": "client","affiliation": "","attrs": [
                    {
                        "name": "hf.AffiliationMgr","value": "1"
                    },{
                        "name": "hf.Registrar.Roles","value": "*"
                    },{
                        "name": "hf.Registrar.DelegateRoles",{
                        "name": "hf.Revoker",{
                        "name": "hf.IntermediateCA",{
                        "name": "hf.GenCRL",{
                        "name": "hf.Registrar.Attributes","value": "*"
                    }
                ],"max_enrollments": -1
            },...
]

解决方法

已禁用CA中的身份删除。在fabric-ca-server config.yaml中添加以下属性(allowremove:true)。

#############################################################################
# CA configuration section
#
# Configure the number of incorrect password attempts are allowed for
# identities. By default,the value of 'passwordattempts' is 10,which
# means that 10 incorrect password attempts can be made before an identity get
# locked out.
#############################################################################
cfg:
  identities:
    passwordattempts: 10
      allowremove: true 

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...