Hyperledger Composer-NetworkAdmin#admin对网络没有读取访问权限

时间:2019-04-11 11:46:20

标签: docker hyperledger-fabric hyperledger hyperledger-composer

遵循本教程https://medium.freecodecamp.org/how-to-build-a-blockchain-network-using-hyperledger-fabric-and-composer-e06644ff801d

当我使用命令时:

composer network start --networkName my-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file my-network-admin.card

我成功创建了卡,并使用以下命令将其导入:

composer card import --file my-network-admin.card

但是,问题出在使用以下命令:

composer network ping --card admin@my-network

我收到以下错误:

  

事务以失败返回:AccessException:参与者'org.hyperledger.composer.system.NetworkAdmin#admin'对资源'org.hyperledger.composer.system.Network#my-network@0.0没有读取权限。 1'   命令失败

我查看了文档,并尝试重新启动整个过程几次,但无济于事。我什至尝试将以下内容添加到我的permissions.acl文件中:

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

rule Default {
description: "Grant all access by default"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "**"
action: ALLOW
}

rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}

rule NetworkAdminSystem {
description: "Grant business network administrators full access to system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}

编辑:

运行composer card list -c admin@my-network时,我得到以下信息:

userName:            admin
description:         
businessNetworkName: my-network
identityId:          fc63d3e4b3b3d73a2be2943a0c422e7af862207f9489fc1ce3707e8769efc99b
roles: 
  - PeerAdmin
connectionProfile: 
  name:   hlfv1
  x-type: hlfv1
credentials:         Credentials set

Command succeeded

0 个答案:

没有答案