Hyperledger Fabric的ChannelCreationPolicy [英] Hyperledger fabric's ChannelCreationPolicy
问题描述
我在为创建频道(ChannelCreationPolicy)编写策略而苦苦挣扎,这是我的configtx.yaml
I am struggling so hard to write policy for creating channel (ChannelCreationPolicy) here is my configtx.yaml
---
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: ../crypto-config/ordererOrganizations/orderer-org/msp
- &ShopOrg
Name: ShopOrgMSP
ID: ShopOrgMSP
MSPDir: ../crypto-config/peerOrganizations/shop-org/msp
AnchorPeers:
- Host: shop-peer-0
Port: 7051
Orderer: &OrdererDefaults
OrdererType: solo
Addresses:
- orderer0:7050
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
Organizations:
Application: &ApplicationDefaults
Organizations:
Profiles:
TwoOrgGenesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
InsuranceConsortium:
# ChannelCreationPolicy:
# Admins:
# Type: Signature
# Rule: "OR('ShopOrgMSP.admin')"
Organizations:
- *ShopOrg
TwoOrgChannel:
Consortium: InsuranceConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *ShopOrg
我试图将ChannelCreationPolicy块放在上面的注释区域中,但是它说:'Profiles[TwoOrgGenesis].Consortiums[InsuranceConsortium]' has invalid keys: ChannelCreationPolicy
I tried to put ChannelCreationPolicy block above in the commented area but it says : 'Profiles[TwoOrgGenesis].Consortiums[InsuranceConsortium]' has invalid keys: ChannelCreationPolicy
在该.yaml中找不到ChannelCreationPolicy的位置.那么如何编写策略,例如,只有ShopOrgMSP管理员才能创建频道?
I can't find place for ChannelCreationPolicy inside that .yaml. So how can I write policy so that, for example, only ShopOrgMSP admins could create channel?
推荐答案
查看 configtxgen的来源,该工具似乎不支持频道创建策略.您需要将此更改作为配置更新事务提交.
Looking at the source for configtxgen, it doesn't look like channel creation policies are supported by the tool. You would need to submit this change as a config update transaction.
不幸的是,这是一个非常简单的过程,但是至少有一个示例(用于将组织添加到频道)
Unfortunately, this is a highly non-trivial process, but at least there is an example (for adding an org to a channel) here.
这篇关于Hyperledger Fabric的ChannelCreationPolicy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!