**
問題:
**當執行../bin/configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block -channelID channel00
時出現錯誤如下:
錯誤提示:Could not find profile: TwoOrgsOrdererGenesis. Please make sure that FABRIC_CFG_PATH or -configPath is set to a path which contains configtx.yaml with the specified profile
問題分析:根據出現的提示,做一下分析判斷:
- 判斷文件
configtx.yaml
是否存在。存在
- 判斷FABRIC_CFG_PATH是否正確。
echo $FABRIC_CFG_PATH
正確
- 可以判斷問題是出在
configtx.yaml
中,打開這個文件,找到profile
,看裏面是否存在TwoOrgsOrdererGenesis
。
發現TwoOrgsOrdererGenesis
並不存在,所以可以斷定是這個文件中出了問題。
網上找到的關於這個文件是這樣的:
Profiles:
TwoOrgsOrdererGenesis:
Capabilities:
<<: *ChannelCapabilities
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Capabilities:
<<: *OrdererCapabilities
Consortiums:
SampleConsortium:
Organizations:
- *Org1
- *Org2
TwoOrgsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2
Capabilities:
<<: *ApplicationCapabilities
我使用的是最新版本的fabric
所以可能是因爲最新版本做了一些改動,導致這個文件發生了變化。
我嘗試用以下命令執行:../bin/configtxgen -profile SampleMultiNodeEtcdRaft -outputBlock ./channel-artifacts/genesis.block -channelID channel00
成功執行: