Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/159.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hyperledger fabric 无法在Fabric中创建具有新组织的频道,出现错误:试图包含不在联盟中的成员_Hyperledger Fabric_Hyperledger - Fatal编程技术网

Hyperledger fabric 无法在Fabric中创建具有新组织的频道,出现错误:试图包含不在联盟中的成员

Hyperledger fabric 无法在Fabric中创建具有新组织的频道,出现错误:试图包含不在联盟中的成员,hyperledger-fabric,hyperledger,Hyperledger Fabric,Hyperledger,以下是我需要分步骤执行的操作: 创建具有2个组织的结构网络:组织1和组织2 在它们之间创建一个频道:publicchannel 现在使用本教程中的步骤按结构添加Org3: 在org3和org1之间创建一个新通道:ORG3ORG1通道 我在步骤4中遇到问题,它正在返回: 错误:获得意外状态:错误请求--试图包含不在联合体中的成员 当我跑步时: peer channel create-o order.example.com:7050-c$channel_NAME-f./channel artifa

以下是我需要分步骤执行的操作:

  • 创建具有2个组织的结构网络:组织1和组织2
  • 在它们之间创建一个频道:publicchannel
  • 现在使用本教程中的步骤按结构添加Org3:
  • 在org3和org1之间创建一个新通道:ORG3ORG1通道
  • 我在步骤4中遇到问题,它正在返回:

    错误:获得意外状态:错误请求--试图包含不在联合体中的成员
    
    当我跑步时:

    peer channel create-o order.example.com:7050-c$channel_NAME-f./channel artifacts/channel.tx--tls--cafile/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/orderOrderOrganizations/example.com/orders/order.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    
    此外,我还要确保所有路径和环境变量都是正确的

    这是我的configtx.yaml文件:

    Organizations:
        - &OrdererOrg
            Name: OrdererOrg
            ID: OrdererMSP
            MSPDir: crypto-config/ordererOrganizations/example.com/msp
    
        - &Org1
            Name: Org1MSP
            ID: Org1MSP
            MSPDir: crypto-config/peerOrganizations/org1.example.com/msp
            AnchorPeers:
                - Host: peer0.org1.example.com
                  Port: 7051
    
        - &Org2
            Name: Org2MSP
            ID: Org2MSP
            MSPDir: crypto-config/peerOrganizations/bitpay.example.com/msp
            AnchorPeers:
                - Host: peer0.org2.example.com
                  Port: 7051
    
    Capabilities:
        Global: &ChannelCapabilities
            V1_1: true
        Orderer: &OrdererCapabilities
            V1_1: true
        Application: &ApplicationCapabilities
            V1_2: true
    
    Application: &ApplicationDefaults
        Organizations:
    
    Orderer: &OrdererDefaults
        OrdererType: solo
        Addresses:
            - orderer.example.com:7050
        BatchTimeout: 2s
        BatchSize:
            MaxMessageCount: 10
            AbsoluteMaxBytes: 99 MB
            PreferredMaxBytes: 512 KB
        Kafka:
            Brokers:
                - 127.0.0.1:9092
        Organizations:
    
    Profiles:
        ExampleOrdererGenesis:
            Capabilities:
                <<: *ChannelCapabilities
            Orderer:
                <<: *OrdererDefaults
                Organizations:
                    - *OrdererOrg
                Capabilities:
                    <<: *OrdererCapabilities
            Consortiums:
                ExampleConsortium:
                    Organizations:
                        - *Org1
                        - *Org2
        ExampleChannel:
            Consortium: ExampleConsortium
            Application:
                <<: *ApplicationDefaults
                Organizations:
                    - *Org1
                    - *Org2
                Capabilities:
                    <<: *ApplicationCapabilities
        TestChannel:
            Consortium: ExampleConsortium
            Application:
                <<: *ApplicationDefaults
                Organizations:
                    - *Org1
                    - *Org3
                Capabilities:
                    <<: *ApplicationCapabilities
    

    我认为问题在于
    示例ordergenesis
    包含一个联合体定义,而不包括
    Org3
    。是否有人可以帮助我使用configtxlator工具更新此部分的步骤?

    每次向联盟中添加新组织时,您都必须更新此部分:

    ExampleOrdererGenesis:
            Capabilities:
                <<: *ChannelCapabilities
            Orderer:
                <<: *OrdererDefaults
                Organizations:
                    - *OrdererOrg
                Capabilities:
                    <<: *OrdererCapabilities
            Consortiums:
                ExampleConsortium:
                    Organizations:
                        - *Org1
                        - *Org2
                        - *Org3
                        - *Org4
    
    示例订单生成:
    能力:
    
    要向联合体添加新组织,请执行以下步骤:

       $: peer channel fetch config config_block.pb -o orderer.example.com:7050
        -c testchainid
    
       $: configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config > config.json
    
       $: jq -s '.[0] * {"channel_group":{"groups":{"Consortiums":{"groups": {"TestConsortium": {"groups": {"Org3MSP":.[1]}}}}}}}' config.json ./org3.json > modified_config.json
    
       $: configtxlator proto_encode --input config.json --type common.Config
        --output config.pb
    
       $: configtxlator proto_encode --input modified_config.json --type common.Config --output modified_config.pb
    
      $:  configtxlator compute_update --channel_id testchainid --original config.pb --updated modified_config.pb --output org_update.pb
    
       $: configtxlator proto_decode --input  org_update.pb --type common.ConfigUpdate | jq . > org_update.json
    
      $:  echo '{"payload":{"header":{"channel_header":{"channel_id":"testchainid", "type":2}},"data":{"config_update":'$(cat org_update.json)'}}}' | jq . > org_update_in_envelope.json
    
       $: configtxlator proto_encode --input org_update_in_envelope.json --type common.Envelope --output org_update_in_envelope.pb
    
       $: peer channel signconfigtx -f org_update_in_envelope.pb
    
       $: peer channel update -f org_update_in_envelope.pb -c testchainid -o orderer.example.com:7050
    

    我用这个链接解决了这个问题:


    确保您了解在上述链接的步骤中,
    testchaninid
    是什么。当我们使用
    peer
    命令启动genesis block事务时,我们为订购方创建一个通道。我们正在获取并更新该频道,而不是任何其他频道。

    这不起作用,因为我无法重新启动网络。如果我可以,这将是一个非常简单的解决方案。请参阅,我已经使用
    exampleordergenesis
    触发了genesis块事务,其中我的联合体定义不包括Org4。现在我需要一种更新Genesis事务的方法。
       $: peer channel fetch config config_block.pb -o orderer.example.com:7050
        -c testchainid
    
       $: configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config > config.json
    
       $: jq -s '.[0] * {"channel_group":{"groups":{"Consortiums":{"groups": {"TestConsortium": {"groups": {"Org3MSP":.[1]}}}}}}}' config.json ./org3.json > modified_config.json
    
       $: configtxlator proto_encode --input config.json --type common.Config
        --output config.pb
    
       $: configtxlator proto_encode --input modified_config.json --type common.Config --output modified_config.pb
    
      $:  configtxlator compute_update --channel_id testchainid --original config.pb --updated modified_config.pb --output org_update.pb
    
       $: configtxlator proto_decode --input  org_update.pb --type common.ConfigUpdate | jq . > org_update.json
    
      $:  echo '{"payload":{"header":{"channel_header":{"channel_id":"testchainid", "type":2}},"data":{"config_update":'$(cat org_update.json)'}}}' | jq . > org_update_in_envelope.json
    
       $: configtxlator proto_encode --input org_update_in_envelope.json --type common.Envelope --output org_update_in_envelope.pb
    
       $: peer channel signconfigtx -f org_update_in_envelope.pb
    
       $: peer channel update -f org_update_in_envelope.pb -c testchainid -o orderer.example.com:7050