简体   繁体   English

无法执行End-2-End方案Hyperledger架构第一个网络

[英]FAILED to execute End-2-End Scenario Hyperledger fabric first network

I have cloned fabric samples project, I'm running first-network module.I have successfully generated crypto material with 我已经克隆了面料样品项目,我正在运行第一个网络模块。

$`./byfn generate 

`When I try to bring up the network with the below command `当我尝试使用以下命令启动网络时

$ ./byfn up

The error repeats in spite of removing containers and networks. 尽管删除了容器和网络,该错误仍会重复。

The containers are being created and i'm getting the below issue, 正在创建容器,而我遇到了以下问题,

proposal failed (err: rpc error: code = Unavailable desc = transport is closing)

The total log looks like this 总日志如下所示

    Creating peer1.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating orderer.example.com    ... done
Creating peer0.org2.example.com ... done
Creating peer1.org1.example.com ... done
Creating cli                    ... done

 ____    _____      _      ____    _____ 
/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |  
 ___) |   | |    / ___ \  |  _ <    | |  
|____/    |_|   /_/   \_\ |_| \_\   |_|  

Build your first network (BYFN) end-to-end test

Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2018-10-04 09:52:41.909 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-10-04 09:52:42.241 UTC [channelCmd] InitCmdFactory -> INFO 002 Endorser and orderer connections initialized
2018-10-04 09:52:42.467 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-10-04 09:52:42.694 UTC [main] main -> INFO 004 Exiting.....
===================== Channel 'mychannel' created ===================== 

Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=1
+ set +x
2018-10-04 09:52:42.841 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: proposal failed (err: rpc error: code = Unavailable desc = transport is closing)
Usage:
  peer channel join [flags]

Flags:
  -b, --blockpath string   Path to file containing genesis block

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
  -v, --version                             Display current version of fabric peer server

peer0.org1 failed to join the channel, Retry after 3 seconds
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: Error getting endorser client channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
Usage:
  peer channel join [flags]

Flags:
  -b, --blockpath string   Path to file containing genesis block

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
  -v, --version                             Display current version of fabric peer server

peer0.org1 failed to join the channel, Retry after 3 seconds
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: Error getting endorser client channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
Usage:
  peer channel join [flags]

Flags:
  -b, --blockpath string   Path to file containing genesis block

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
  -v, --version                             Display current version of fabric peer server

peer0.org1 failed to join the channel, Retry after 3 seconds
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: Error getting endorser client channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
Usage:
  peer channel join [flags]

Flags:
  -b, --blockpath string   Path to file containing genesis block

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
  -v, --version                             Display current version of fabric peer server

peer0.org1 failed to join the channel, Retry after 3 seconds
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: Error getting endorser client channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
Usage:
  peer channel join [flags]

Flags:
  -b, --blockpath string   Path to file containing genesis block

Global Flags:
      --cafile string                       Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
      --certfile string                     Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
      --clientauth                          Use mutual TLS when communicating with the orderer endpoint
      --keyfile string                      Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
      --logging-level string                Default logging level and overrides, see core.yaml for full syntax
  -o, --orderer string                      Ordering service endpoint
      --ordererTLSHostnameOverride string   The hostname override to use when validating the TLS connection to the orderer.
      --tls                                 Use TLS when communicating with the orderer endpoint
  -v, --version                             Display current version of fabric peer server

!!!!!!!!!!!!!!! After 5 attempts, peer0.org1 has failed to join channel 'mychannel'  !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

ERROR !!!! Test failed

I'm using 我正在使用

  • docker 18.03.1-ce 码头工人18.03.1-ce
  • docker-compose 1.22.0 码头工人组成1.22.0
  • node 8.9.4 节点8.9.4
  • npm 5.6.0 npm 5.6.0
  • go 1.11 去1.11
  • ubuntu 16.04 Ubuntu 16.04

logs of peer0.org1 container peer0.org1容器的日志

Version: 1.1.0
 Go version: go1.9.2
 OS/Arch: linux/amd64
 Experimental features: false
 Chaincode:
  Base Image Version: 0.4.6
  Base Docker Namespace: hyperledger
  Base Docker Label: org.hyperledger.fabric
  Docker Namespace: hyperledger

2018-10-09 04:45:58.815 UTC [ledgermgmt] initialize -> INFO 003 Initializing ledger mgmt
2018-10-09 04:45:58.835 UTC [kvledger] NewProvider -> INFO 004 Initializing ledger provider
2018-10-09 04:46:13.391 UTC [kvledger] NewProvider -> INFO 005 ledger provider Initialized
2018-10-09 04:46:13.391 UTC [ledgermgmt] initialize -> INFO 006 ledger mgmt initialized
2018-10-09 04:46:13.392 UTC [peer] func1 -> INFO 007 Auto-detected peer address: 172.19.0.2:7051
2018-10-09 04:46:13.392 UTC [peer] func1 -> INFO 008 Returning peer0.org1.example.com:7051
2018-10-09 04:46:13.393 UTC [peer] func1 -> INFO 009 Auto-detected peer address: 172.19.0.2:7051
2018-10-09 04:46:13.393 UTC [peer] func1 -> INFO 00a Returning peer0.org1.example.com:7051
2018-10-09 04:46:13.858 UTC [nodeCmd] serve -> INFO 00b Starting peer with TLS enabled
2018-10-09 04:46:13.861 UTC [eventhub_producer] start -> INFO 00c Event processor started
2018-10-09 04:46:13.861 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00d Entering computeChaincodeEndpoint with peerHostname: peer0.org1.example.com
.
.
.
Orderer/OrdererOrg/Readers:0xc4217e8780 Application/Admins:0xc42179ad80] map[Orderer:0xc4217e8960 Application:0xc4217e8ea0]})}] incompatible Application capability V1_2 is required but not supported

goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/github.com/op/go-logging.(*Logger).Panicf(0xc4202ca660, 0xefeec0, 0x1c, 0xc4217e9160, 0x2, 0x2)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/op/go-logging/logger.go:194 +0x134
github.com/hyperledger/fabric/core/peer.capabilitiesSupportedOrPanic(0x166ba20, 0xc42193e280)
    /opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:131 +0x338
github.com/hyperledger/fabric/core/peer.createChain(0xc4220c9640, 0x9, 0x166e8a0, 0xc4217412a0, 0xc4217414e0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:300 +0xdc
github.com/hyperledger/fabric/core/peer.Initialize(0xf33be0)
    /opt/gopath/src/github.com/hyperledger/fabric/core/peer/peer.go:224 +0x748
github.com/hyperledger/fabric/peer/node.serve(0x16c5708, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:280 +0x1048
github.com/hyperledger/fabric/peer/node.glob..func1(0x164ce80, 0x16c5708, 0x0, 0x0, 0x0, 0x0)
    /opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:87 +0x3f
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x164ce80, 0x16c5708, 0x0, 0x0, 0x164ce80, 0x16c5708)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:599 +0x3e8
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x164d4e0, 0x11, 0xc42030e230, 0x5)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:689 +0x2fe
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(0x164d4e0, 0x1b, 0xc4200160b5)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:648 +0x2b
main.main()
    /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:112 +0x5e1

PS : I'm not pasting the intermediate logs of the container. PS:我没有粘贴容器的中间日志。

Any help is appreciated. 任何帮助表示赞赏。 Thanks 谢谢

you should follow the following link 您应该点击以下链接

and after generating the crypto material run the following command to up the network 并生成加密材料后,运行以下命令以建立网络

./byfn.sh -m up -s couchdb -a

if you faced the same issue just tear it down and bing it up again 如果您遇到相同的问题,只需将其拆下再重新包装

./byfn.sh -m down

then 然后

./byfn.sh -m up -s couchdb -a

First check that your cryptogen tool (the one you have setted in your path) is the one that you are using in your example, is very common to be pointing to an old version tool. 首先检查您的密码原cryptogen tool (您在路径中设置的那个)是否是您在示例中使用的那个,通常指向旧版本的工具。

I highly recommend if you are going to restart everything to clean all your containers running 我强烈建议您是否要重新启动一切以清理所有正在运行的容器

  1. ./byfn.sh -m down ./byfn.sh -m下
  2. docker stop $(docker ps -a -q) 码头工人停止$(docker ps -a -q)
  3. docker rm $(docker ps -a -q) 泊坞窗rm $(docker ps -a -q)

After that re run the start command ./byfn.sh -m up -s couchdb -a 之后,重新运行启动命令./byfn.sh -m up -s couchdb -a

If you are still having problems, maybe you can start with an easier example, I figured out how to setup a Fabric (v1.2) y 2 differents hosts using the basic network example. 如果仍然有问题,也许您可​​以从一个简单的示例开始,我想出了如何使用基本网络示例设置Fabric(v1.2)和2个不同主机的方法。

Setup hyperledger fabric in multiple physical machines 在多台物理机中设置超级账本结构

Hope that this help! 希望对您有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM