为什么deliverBlocks失败并出现策略评估错误?

时间:2019-04-03 08:27:14

标签: hyperledger-fabric

我正在基于2.0快照运行光纤网络,订购者拒绝了带有错误错误的块。
知道配置有什么问题吗?

Organizations:
    - &orderer
        Name: orderer
        ID: orderer
        MSPDir: crypto-config/ordererOrganizations/example.com/msp
        Policies:
            Readers:
                Type: Signature
                Rule: OR('orderer.member')
            Writers:
                Type: Signature
                Rule: OR('orderer.member')
            Admins:
                Type: Signature
                Rule: OR('orderer.admin')


    - &partya
        Name: partya
        ID: partya
        MSPDir: crypto-config/peerOrganizations/partya.example.com/msp
        Policies:
            Readers:
                Type: Signature
                Rule: OR('partya.admin', 'partya.peer', 'partya.client')
            Writers:
                Type: Signature
                Rule: OR('partya.admin', 'partya.client')
            Admins:
                Type: Signature
                Rule: OR('partya.admin')
        AnchorPeers:
            - Host: partya
              Port: 7051

    - &partyb
        Name: partyb
        ID: partyb
        MSPDir: crypto-config/peerOrganizations/partyb.example.com/msp
        Policies:
            Readers:
                Type: Signature
                Rule: OR('partyb.admin', 'partyb.peer', 'partyb.client')
            Writers:
                Type: Signature
                Rule: OR('partyb.admin', 'partyb.client')
            Admins:
                Type: Signature
                Rule: OR('partyb.admin')
        AnchorPeers:
            - Host: partyb
              Port: 7051

    - &partyc
        Name: partyc
        ID: partyc
        MSPDir: crypto-config/peerOrganizations/partyc.example.com/msp
        Policies:
            Readers:
                Type: Signature
                Rule: OR('partyc.admin', 'partyc.peer', 'partyc.client')
            Writers:
                Type: Signature
                Rule: OR('partyc.admin', 'partyc.client')
            Admins:
                Type: Signature
                Rule: OR('partyc.admin')
        AnchorPeers:
            - Host: partyc
              Port: 7051

Capabilities:
    Channel: &ChannelCapabilities
        V2_0: true
    Orderer: &OrdererCapabilities
        V1_1: true

Channel: &ChannelDefaults
    Policies:
        Readers:
            Type: ImplicitMeta
            Rule: ANY Readers
        Writers:
            Type: ImplicitMeta
            Rule: ANY Writers
        Admins:
            Type: ImplicitMeta
            Rule: MAJORITY Admins

Orderer: &OrdererDefaults
    OrdererType: solo
    Capabilities:
        V1_1: true
    Addresses:
        - owneraorderer:7050
    BatchTimeout: 2s
    BatchSize:
        MaxMessageCount: 10
        AbsoluteMaxBytes: 99 MB
        PreferredMaxBytes: 512 KB
    Policies:
        Readers:
          Type: ImplicitMeta
          Rule: ANY Readers
        Writers:
          Type: ImplicitMeta
          Rule: ANY Writers
        Admins:
          Type: ImplicitMeta
          Rule: MAJORITY Admins
        BlockValidation:
            Type: ImplicitMeta
            Rule: ANY Writers
    Organizations:

Application: &ApplicationDefaults
    Capabilities:
        V2_0: true
    Policies:
        Readers:
          Type: ImplicitMeta
          Rule: ANY Readers
        Writers:
          Type: ImplicitMeta
          Rule: ANY Writers
        Admins:
          Type: ImplicitMeta
          Rule: MAJORITY Admins
    Organizations:

Profiles:
    OwneraNetGenesis:
        <<: *ChannelDefaults
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *orderer
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *partya
                    - *partyb
                    - *partyc
    OwneraChannel:
        <<: *ChannelDefaults
        Consortium: SampleConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *partya
                - *partyb
                - *partyc

建立网络时出现以下错误:

owneraorderer | 2019-04-03 08:18:51.595 UTC [common.deliver] deliverBlocks -> WARN 10242 [channel: identities] Client authorization revoked for deliver request from 172.18.0.2:46308: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied
partyc       | 2019-04-03 08:18:51.597 UTC [blocksProvider] DeliverBlocks -> ERRO 2a1 [identities] Got error &{FORBIDDEN}

1 个答案:

答案 0 :(得分:0)

对我来说,它是通过创建config.yaml文件来解决的,例如:

./ crypto-config / peerOrganizations / org1.example.com / msp / config.yaml ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp/config.yaml ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/config.yaml ./crypto-config/peerOrganizations/org2.example.com/msp/config.yaml ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/config.yaml ./crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/msp/config.yaml