Hyperledger fabric's ChannelCreationPolicy

有些话、适合烂在心里 提交于 2019-12-06 13:50:27

问题


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

I tried to put ChannelCreationPolicy block above in the commented area but it says : 'Profiles[TwoOrgGenesis].Consortiums[InsuranceConsortium]' has invalid keys: ChannelCreationPolicy

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?


回答1:


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.



来源:https://stackoverflow.com/questions/53658094/hyperledger-fabrics-channelcreationpolicy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!