问题描述
我使用 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