【问题标题】:Issue in creating anchor peer for the organization为组织创建锚点对等点的问题
【发布时间】:2020-07-21 16:59:09
【问题描述】:

我使用结构版本 1.4.4 在频道中创建了一个包含两个组织(Org1,Org2)的网络。我在频道中添加了一个组织。在将新组织添加到频道后,我正在尝试根据此参考 https://hyperledger-fabric.readthedocs.io/en/release-1.4/channel_update_tutorial.html#updating-the-channel-config-to-include-an-org3-anchor-peer-optional 更新锚节点。

但在尝试使用 Org3 签署更新事务时会引发错误。

Error: got unexpected status: BAD_REQUEST -- error applying config update to existing 
channel 'masterchannel': error authorizing update: error validating DeltaSet: policy for 
[Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 1 sub- 
policies were satisfied, but this policy requires 2 of the 'Admins' sub-policies to be 
satisfied

我尝试使用网络中的另一个 org(org 2) 签署交易。它引发了另一个错误,如下所示。

 Error: got unexpected status: BAD_REQUEST -- error applying config update to existing 
 channel 'mychannel': error authorizing update: error validating DeltaSet: invalid 
 mod_policy for element [Group]  /Channel/Application/Org3: mod_policy not set

我附上了关于应用程序功能的 configtx.yaml。

       Application: &ApplicationCapabilities
           V1_4_2: true
           V1_3: false
           V1_2: false
           V1_1: false

谁能帮我解决锚更新中的错误?

【问题讨论】:

    标签: hyperledger-fabric hyperledger-fabric-ca hyperledger-fabric-sdk-js


    【解决方案1】:

    上述错误是由于通道配置中的策略定义无效。

    组织的政策在 configtx.yaml 文件中定义如下:-

        Organizations:
          - &Org3
              Name: Org3MSP
              ID: Org3MSP
              MSPDir: 'crypto-config/peerOrganizations/org3.example.co/msp'
              Policies:
                   Admins:
                      Type: Signature
                      Rule: "OR('Org3.admin')"
      
    

    anchor peer 更新是对 Org3 的更新,因此我们只需要 Org3 管理员的签名即可按照 configtx.yaml 文件中定义的策略进行配置更新。

    mod_policy 错误是由于我们在频道的应用程序组字段中提到的 Org3 的名称无效。

    我们必须使用我们在 configtx.yaml 文件中定义的组织名称 频道的应用程序组字段。

    我已将名称 Org3 替换为 Org3Msp(configtx.yaml 中的组织名称)以解决错误。

    jq '.channel_group.groups.Application.groups.**Org3MSP**.values += {"AnchorPeers": 
    {"mod_policy": "Admins","value":{"anchor_peers": [{"host": 
    "peer0.org3.example.com","port": 11051}]},"version": "0"}}' config.json > 
     modified_anchor_config.json
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-13
      • 1970-01-01
      相关资源
      最近更新 更多