1

我正在努力编写创建频道 (ChannelCreationPolicy) 的策略,这是我的 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

我在那个 .yaml 中找不到 ChannelCreationPolicy 的位置。那么我该如何编写策略,例如,只有 ShopOrgMSP 管理员可以创建频道?

4

1 回答 1

1

查看configtxgen 的源代码,该工具似乎不支持通道创建策略。您需要将此更改作为配置更新事务提交。

不幸的是,这是一个非常重要的过程,但至少这里有一个示例(用于将组织添加到频道

于 2018-12-07T11:33:48.123 回答