使用Hyperledger Fabric创建频道失败吗?

时间:2019-03-05 04:41:25

标签: hyperledger-fabric hyperledger

我在docker中使用Hyperledger架构构建了一个自定义网络。但是,当我尝试建立频道时,此错误失败。

 Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining

当我寻找订购者的日志时,它将其留在终端上。

2019-03-05 04:24:56.368 UTC [orderer.common.server] Start -> INFO 007 Beginning to serve requests
2019-03-05 04:25:52.201 UTC [orderer.common.broadcast] ProcessMessage -> WARN 008 [channel: trafficfine] Rejecting broadcast of config message from 172.19.0.21:37180 because of error: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining
2019-03-05 04:25:52.202 UTC [comm.grpc.server] 1 -> INFO 009 streaming call completed {"grpc.start_time": "2019-03-05T04:25:52.109Z", "grpc.service": "orderer.AtomicBroadcast", "grpc.method": "Broadcast", "grpc.peer_address": "172.19.0.21:37180", "grpc.code": "OK", "grpc.call_duration": "92.6116ms"}
2019-03-05 04:25:52.209 UTC [common.deliver] Handle -> WARN 00a Error reading from 172.19.0.21:37178: rpc error: code = Canceled desc = context canceled
2019-03-05 04:25:52.210 UTC [comm.grpc.server] 1 -> INFO 00b streaming call completed {"grpc.start_time": "2019-03-05T04:25:52.098Z", "grpc.service": "orderer.AtomicBroadcast", "grpc.method": "Deliver", "grpc.peer_address": "172.19.0.21:37178", "error": "rpc error: code = Canceled desc = context canceled", "grpc.code": "Canceled", "grpc.call_duration": "111.5112ms"}

这是我的订购器设置的样子。

orderer.example.com:
    container_name: orderer.example.com
    image: hyperledger/fabric-orderer:latest
    environment:
      - ORDERER_GENERAL_LOGLEVEL=INFO
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
      #enabled TLS
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
      - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
      - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    volumes:
      - ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
      - ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
      - ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
      - orderer.example.com:/var/hyperledger/production/orderer
    ports:
      - 7050:7050

我尝试了这个问题中提出的所有建议。

peer channel creation fails in Hyperledger Fabric

但是我无法找出我做错了什么。有人可以帮我解决这个问题吗?谢谢。

2 个答案:

答案 0 :(得分:0)

该错误表明您要创建的频道已经创建,并且您正在尝试使用channel.tx文件再次创建该频道。可能您没有清除docker容器,也没有完全重启容器。

要进行验证,请尝试更改频道名称,重新创建诸如anchor.txchannel.tx文件之类的工件,然后使用新的名称和文件重新提交。

要清洁Docker容器并完全重新启动,请执行以下操作:

注意:根据<consortiumName >文件中指定的内容替换configtx.yaml

  • docker rm -f -v `docker ps -a --no-trunc | grep "<consortiumName>-" | cut -d ' ' -f 1` 2>/dev/null || true
  • docker rmi `docker images --no-trunc | grep "<consortiumName>-" | cut -d ' ' -f 1` 2>/dev/null || true

答案 1 :(得分:0)

我也遇到了同样的问题,只是因为我在网络定义配置事务文件(configtx.yaml)中犯了一些愚蠢的错误,因此请一次验证您的通道工件配置。