首页 > 解决方案 > 如何在 Hyperledger Fabric 网络中将 peer 配置为 admin peer?

问题描述

当我尝试使用以下命令创建新通道时,我已经在本地机器上设置了结构网络:

./peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls --cafile /home/appinventiv/binaries/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

我收到此错误:

/Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining

和 orderer 调试日志显示:

Evaluation Failed: Only 0 policies were satisfied, but needed 1 of [ Org2MSP.Admins Org1MSP.Admins ]

所以我想,peer 必须是管理员才能创建频道。

如果我错了,请纠正我。

标签: hyperledger-fabrichyperledger

解决方案


您是否将环境变量设置为正确的值?我建议创建一个 .sh 文件并从那里导出所有内容,例如:

export CORE_PEER_ID=peer1
export CORE_PEER_FILESYSTEMPATH="./ledgers/peer1/ledger"
export CORE_PEER_MSPCONFIGPATH="$PWD/../fabric-ca/client/org1/admin/msp"
export CORE_PEER_LOCALMSPID=OrgMSP
export CORE_PEER_LISTENADDRESS=0.0.0.0:7051
export CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
export CORE_PEER_EVENTS_ADDRESS=0.0.0.0:7053
export FABRIC_CFG_PATH="$PWD"

您应该使用您的值设置它们,因为我可能有不同的设置然后运行:(在 ./ 前面也有点)

. ./setEnv.sh

推荐阅读