Hyperledger Fabric的ChannelCreationPolicy

时间:2018-12-06 19:05:50

标签: hyperledger-fabric hyperledger blockchain policies

我在为创建频道(ChannelCreationPolicy)编写策略而苦苦挣扎,这是我的configtx.yaml

loader: "postcss-loader",
options: {
   ident: "postcss",
   plugins: loader => [
      require("postcss-import")()
      require("postcss-css-variables")(),
      require("postcss-cssnext")(),
      require("autoprefixer")(),

   ]
}

我试图将ChannelCreationPolicy块放在上面的注释区域中,但是它说:--- 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

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

1 个答案:

答案 0 :(得分:1)

the source for configtxgen看,该工具似乎不支持频道创建策略。您需要将此更改作为配置更新事务提交。

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