hyperledger-fabric - 如何在 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 必须是管理员才能创建频道。
如果我错了,请纠正我。
解决方案
您是否将环境变量设置为正确的值?我建议创建一个 .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
推荐阅读
- ios - 如何接收 json 字符串并将其转换为字典?
- reactjs - 状态变量显示值“未定义”,但已设置默认值“假”
- azureservicebus - WebJobs 和服务总线触发函数 - 性能注意事项
- swift - 如何处理失败的可选绑定
- python - 在默认 Django 表单中添加单选按钮:
- ios - 在 iOS 中处理另一个任务时呈现视图
- browser - BrowserComponent 产生 NullPointerException
- mysql - 我可以在 MySQL 中使用什么来代替 CASE WHEN THEN?
- reactjs - 从 React.js 转换为 React.tsx 属性 'id' 不存在于类型 'never' 上。TS2339
- html - 媒体查询停止覆盖?