НЕ удалось выполнить первую сетевую сеть Hyperledger End-2-End Scenario - PullRequest
0 голосов
/ 04 октября 2018

У меня есть проект клонированных образцов фабрики, я использую модуль первой сети. Я успешно сгенерировал криптографический материал с помощью

$`./byfn generate 

`Когда я пытаюсь вызвать сеть с помощью следующей команды

$ ./byfn up

Ошибка повторяется, несмотря на удаление контейнеров и сетей.

Создаются контейнеры, и я получаю следующую проблему,

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

Общий журналвыглядит так

    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

Я использую

  • docker 18.03.1-ce
  • docker-compose 1.22.0
  • узел8.9.4
  • npm 5.6.0
  • go 1.11
  • ubuntu 16.04

журналы контейнера 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: я не вставляю промежуточные журналы контейнера.

Любая помощь приветствуется.Спасибо

Ответы [ 2 ]

0 голосов
/ 09 октября 2018

Сначала убедитесь, что ваш cryptogen tool (тот, который вы установили на своем пути) - это тот, который вы используете в своем примере, очень часто указывают на инструмент старой версии.

IНастоятельно рекомендуем, если вы собираетесь перезапустить все, чтобы очистить все ваши контейнеры, работающие

  1. . / byfn.sh -m down
  2. docker stop $ (docker ps -a -q)
  3. docker rm $ (docker ps -a -q)

После этого снова запустите команду запуска ./byfn.sh -m up -s couchdb -a

Если у вас все еще есть проблемы, возможно, выМожно начать с более простого примера. Я выяснил, как настроить Fabric (v1.2) и 2 разных хоста, используя базовый пример сети.

Настройка фабрики hyperledger на нескольких физических машинах

Надеюсь, что это поможет!

0 голосов
/ 09 октября 2018

вам следует перейти по следующей ссылке

, и после генерации криптографического материала выполните следующую команду для запуска сети

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

, если вы столкнулись с той же проблемойпросто снеси его и подними снова

./byfn.sh -m down

затем

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