无法生成订单生成块

时间:2018-07-06 13:46:13

标签: hyperledger-fabric blockchain hyperledger

我正在尝试使用超账结构构建网络,但是每次它向我显示错误时。

我也正在使用docker镜像1.0.3。

 npm version: 5.6.0
    nodejs version: v4.2.6

Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:16:25 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   f150324
  Built:        Wed May  9 22:14:32 2018
  OS/Arch:      linux/amd64
  Experimental: false


docker-compose version 1.16.0-rc1, build 9bea70a
docker-py version: 2.5.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t  3 May 2016



 Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
    Continue? [Y/n] y
    proceeding ...
    /home/bashayer/fabric-samples/first-network/../bin/cryptogen

    ##########################################################
    ##### Generate certificates using cryptogen tool #########
    ##########################################################
    + cryptogen generate --config=./crypto-config.yaml
    org1.example.com
    org2.example.com
    + res=0
    + set +x

    /home/bashayer/fabric-samples/first-network/../bin/configtxgen
    ##########################################################
    #########  Generating Orderer Genesis block ##############
    ##########################################################
    + configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
    2018-07-06 16:29:48.898 +03 [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen is deprecated.  Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
    2018-07-06 16:29:48.898 +03 [common/tools/configtxgen] main -> INFO 002 Loading configuration
    2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewChannelGroup -> WARN 003 Default policy emission is deprecated, please include policy specificiations for the channel group in configtx.yaml
    2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererGroup -> WARN 004 Default policy emission is deprecated, please include policy specificiations for the orderer group in configtx.yaml
    2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 005 Default policy emission is deprecated, please include policy specificiations for the orderer org group OrdererOrg in configtx.yaml
    2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 006 Loading NodeOUs
    2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 007 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org1MSP in configtx.yaml
    2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 008 Loading NodeOUs
    2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 009 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org2MSP in configtx.yaml
    2018-07-06 16:29:48.907 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00a Generating genesis block
    2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00b Writing genesis block
    2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] main -> CRIT 00c Error on outputBlock: Error writing genesis block: open ./channel-artifacts/genesis.block: is a directory
    + res=1
    + set +x
    Failed to generate orderer genesis block...

5 个答案:

答案 0 :(得分:0)

发生此问题是因为系统在您的通道工件中找不到任何 genesys.block

确保已在指定位置生成了genesys.block文件。 希望对您有所帮助。

答案 1 :(得分:0)

在我们的情况下,它是缺少的文件夹:./channel-artifacts/ .block文件仍会自动创建

答案 2 :(得分:0)

在我的情况下(Windows 10)在丢失的文件夹中生成了创世纪图块:

$./byfn.sh down
$../bin/cryptogen generate --config=./crypto-config.yaml

Org1.example.com
Org2.example.com
$../bin/configtxgen --profile TwoOrgsOrdererGenesis –outputBlock./channel- 
artifacts/genesis.block
$./byfn.sh generate
$./byfn.sh up

答案 3 :(得分:0)

我遇到类似的错误

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

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=1
+ set +x
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup orderer.example.com on 127.0.0.11:53: no such host"
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

ERROR !!!! Test failed

只需在./byfn.sh up中运行fabric-samples/first-network/即可解决

答案 4 :(得分:0)

使用这个分支 repo release-1.4: https://github.com/hyperledger/fabric-samples/tree/release-1.4

$ git clone --branch release-1.4 https://github.com/hyperledger/fabric-samples.git

无论如何第一网络教程已弃用

并从 10:00 开始尝试此视频:https://www.youtube.com/watch?v=kRwPCPdj86s