1. 程式人生 > >建立第一個Fabric創世快,遇坑Failed to generate orderer genesis block

建立第一個Fabric創世快,遇坑Failed to generate orderer genesis block

按上篇步驟到了建立創世區塊了,然後失敗了,報錯如下

/Users/yiyunyue/fabric/demo1/fabric-samples/first-network/../bin/configtxgen

##########################################################

#########  Generating Orderer Genesis block ##############

##########################################################

+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block

2018-10-31 15:59:56.607 CST [common/configtx/tool] main -> INFO 001 Loading configuration

2018-10-31 15:59:56.637 CST [common/configtx/tool/localconfig] Load -> CRIT 002 Error unmarshaling config into struct:  17 error(s) decoding:

 

* '' has invalid keys: capabilities, channel

* 'Application' has invalid keys: Capabilities, Policies

* 'Orderer' has invalid keys: Capabilities, Policies

* 'Organizations[0]' has invalid keys: Policies

* 'Organizations[1]' has invalid keys: Policies

* 'Organizations[2]' has invalid keys: Policies

* 'Organizations[3]' has invalid keys: MSPType, Policies

* 'Profiles[TwoOrgsChannel].Application' has invalid keys: Capabilities, Policies

* 'Profiles[TwoOrgsChannel].Application.Organizations[0]' has invalid keys: Policies

* 'Profiles[TwoOrgsChannel].Application.Organizations[1]' has invalid keys: Policies

* 'Profiles[TwoOrgsChannel].Application.Organizations[2]' has invalid keys: MSPType, Policies

* 'Profiles[TwoOrgsOrdererGenesis]' has invalid keys: Capabilities, Policies

* 'Profiles[TwoOrgsOrdererGenesis].Consortiums[SampleConsortium].Organizations[0]' has invalid keys: Policies

* 'Profiles[TwoOrgsOrdererGenesis].Consortiums[SampleConsortium].Organizations[1]' has invalid keys: Policies

* 'Profiles[TwoOrgsOrdererGenesis].Consortiums[SampleConsortium].Organizations[2]' has invalid keys: MSPType, Policies

* 'Profiles[TwoOrgsOrdererGenesis].Orderer' has invalid keys: Capabilities, Policies

* 'Profiles[TwoOrgsOrdererGenesis].Orderer.Organizations[0]' has invalid keys: Policies

+ res=1

+ set +x

Failed to generate orderer genesis block...

 

google,stackflow,csdn,意見總結

就是 hyperledger-fabric-darwin-amd64-1.0.5.tar.gz版本與fabric samples新版(git clone https://github.com/hyperledger/fabric-samples.git)不符合,得下載最新版的hyperledger-fabric-darwin-amd64 ,以下是所有版本的地址,自己調對應系統的新版本吧

https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/

接著就是將解壓後的bin,config資料夾都放入fabric samples裡,以前的bin刪掉。

重新執行 ./byfn.sh -m generate ,搞定如下:

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 ...

/Users/yiyunyue/fabric/demo1/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

 

/Users/yiyunyue/fabric/demo1/fabric-samples/first-network/../bin/configtxgen

##########################################################

#########  Generating Orderer Genesis block ##############

##########################################################

+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block

2018-10-31 18:28:01.172 CST [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen for output operations is deprecated.  Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.

2018-10-31 18:28:01.173 CST [common/tools/configtxgen] main -> INFO 002 Loading configuration

2018-10-31 18:28:01.222 CST [common/tools/configtxgen] doOutputBlock -> INFO 003 Generating genesis block

2018-10-31 18:28:01.224 CST [common/tools/configtxgen] doOutputBlock -> INFO 004 Writing genesis block

+ res=0

+ set +x

 

#################################################################

### Generating channel configuration transaction 'channel.tx' ###

#################################################################

+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel

2018-10-31 18:28:01.291 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration

2018-10-31 18:28:01.318 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx

2018-10-31 18:28:01.320 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 003 Writing new channel tx

+ res=0

+ set +x

 

#################################################################

#######    Generating anchor peer update for Org1MSP   ##########

#################################################################

+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP

2018-10-31 18:28:01.362 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration

2018-10-31 18:28:01.382 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update

2018-10-31 18:28:01.382 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

+ res=0

+ set +x

 

#################################################################

#######    Generating anchor peer update for Org2MSP   ##########

#################################################################

+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP

2018-10-31 18:28:01.421 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration

2018-10-31 18:28:01.444 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update

2018-10-31 18:28:01.444 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

+ res=0

+ set +x