创建第一个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

 

你可能感兴趣的:(入门开发者)