I am building a hyperledger fabric from scratch , I took most of the commands from https://github.com/feitnomore/hyperledger-fabric-kubernetes/blob/master/README.md but I am using image docker.io/hyperledger/fabric-tools:2.5.7 for the container.
configtxgen version is :
root@fabric-tools:/fabric# configtxgen -version
configtxgen:
Version: v2.5.7
Commit SHA: 5efcea7
Go version: go1.21.9
OS/Arch: linux/amd64
I got to the part where i have to run the following command in the “fabric-tools” pod :
cd /fabric ; configtxgen -profile FourOrgsOrdererGenesis -outputBlock genesis.block -channelID channel00
The return after that is :
2024-04-29 14:26:31.147 EEST 0001 INFO [common.tools.configtxgen] main -> Loading configuration
2024-04-29 14:26:31.149 EEST 0002 PANI [common.tools.configtxgen.localconfig] Load -> Error reading configuration: yaml: line 227: did not find expected key
2024-04-29 14:26:31.150 EEST 0003 PANI [common.tools.configtxgen] func1 -> Error reading configuration: yaml: line 227: did not find expected key
panic: Error reading configuration: yaml: line 227: did not find expected key [recovered]
panic: Error reading configuration: yaml: line 227: did not find expected key
goroutine 1 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0x46?, {0x0?, 0x0?, 0xc0003b6300?})
/vendor/go.uber.org/zap/zapcore/entry.go:196 +0x54
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0003c8a90, {0x0, 0x0, 0x0})
/vendor/go.uber.org/zap/zapcore/entry.go:262 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc000045d68, 0x4, {0xc00034a140?, 0x0?}, {0x0?, 0xc00034a0f0?, 0x30?}, {0x0, 0x0, 0x0})
/vendor/go.uber.org/zap/sugar.go:316 +0xec
go.uber.org/zap.(*SugaredLogger).Panicf(...)
/vendor/go.uber.org/zap/sugar.go:202
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panic(0xc000045d70, {0xc00050b958?, 0xd24c4c?, 0x16?})
/common/flogging/zap.go:73 +0x57
main.main.func1()
/cmd/configtxgen/main.go:261 +0x1cc
panic({0xbe08a0?, 0xc00032d2f0?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0xcdc801?, {0x0?, 0x0?, 0xc0003b7440?})
/vendor/go.uber.org/zap/zapcore/entry.go:196 +0x54
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0003c8820, {0x0, 0x0, 0x0})
/vendor/go.uber.org/zap/zapcore/entry.go:262 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc000045150, 0x4, {0xd2c91f?, 0x15?}, {0xc00050bd70?, 0xadfa90?, 0xff7744?}, {0x0, 0x0, 0x0})
/vendor/go.uber.org/zap/sugar.go:316 +0xec
go.uber.org/zap.(*SugaredLogger).Panicf(...)
/vendor/go.uber.org/zap/sugar.go:202
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...)
/common/flogging/zap.go:74
github.com/hyperledger/fabric/internal/configtxgen/genesisconfig.Load({0x7ffe2e0e1d8f, 0x16}, {0x0, 0x0, 0xd268df?})
/internal/configtxgen/genesisconfig/config.go:238 +0x1bc
main.main()
/cmd/configtxgen/main.go:279 +0x84c
command terminated with exit code 2
The contents of “configtx.yaml” are :
---
Organizations:
- &OrdererOrg
Name: OrdererOrg
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Writers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Admins:
Type: Signature
Rule: "OR('OrdererMSP.admin')"
- &Org00
Name: Org00MSP
ID: Org00MSP
MSPDir: crypto-config/peerOrganizations/org00.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org00MSP.admin', 'Org00MSP.peer', 'Org00MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org00MSP.admin', 'Org00MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org00MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org00MSP.peer')"
AnchorPeers:
- Host: org00peer0
Port: 301101
- Host: org00peer1
Port: 30110
- &Org01
Name: Org01MSP
ID: Org01MSP
MSPDir: crypto-config/peerOrganizations/org01.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org01MSP.admin', 'Org01MSP.peer', 'Org01MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org01MSP.admin', 'Org01MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org01MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org01MSP.peer')"
AnchorPeers:
- Host: org01peer0
Port: 301101
- Host: org01peer1
Port: 30110
- &Org02
Name: Org02MSP
ID: Org02MSP
MSPDir: crypto-config/peerOrganizations/org02.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org02MSP.admin', 'Org02MSP.peer', 'Org02MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org02MSP.admin', 'Org02MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org02MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org02MSP.peer')"
AnchorPeers:
- Host: org02peer0
Port: 301101
- Host: org02peer1
Port: 30110
- &Org03
Name: Org03MSP
ID: Org03MSP
MSPDir: crypto-config/peerOrganizations/org03.example.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('Org03MSP.admin', 'Org03MSP.peer', 'Org03MSP.client')"
Writers:
Type: Signature
Rule: "OR('Org03MSP.admin', 'Org03MSP.client')"
Admins:
Type: Signature
Rule: "OR('Org03MSP.admin')"
Endorsement:
Type: Signature
Rule: "OR('Org03MSP.peer')"
AnchorPeers:
- Host: org03peer0
Port: 301101
- Host: org03peer1
Port: 30110
Capabilities:
Channel: &ChannelCapabilities
V2_0: true
Orderer: &OrdererCapabilities
V2_0: true
Application: &ApplicationCapabilities
V2_0: true
Application: &ApplicationDefaults
Organizations:
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
LifecycleEndorsement:
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"
Endorsement:
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"
Capabilities:
<<: *ApplicationCapabilities
Orderer: &OrdererDefaults
OrdererType: kafka
Addresses:
- orderer:31010
BatchTimeout: 1s
BatchSize:
MaxMessageCount: 50
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
Kafka:
Brokers: [ 10.0.2.200:9092 , 10.0.2.201:9092 , 10.0.2.202:9092 , 10.0.2.203:9092 ]
Organizations:
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
BlockValidation:
Type: ImplicitMeta
Rule: "ANY Writers"
Channel: &fourorgschannel
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
Capabilities:
<<: *ChannelCapabilities
Profiles:
FourOrgsOrdererGenesis:
<<: *fourorgschannel
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium:
Organizations:
- *Org00
- *Org01
- *Org02
- *Org03
FourOrgsChannel:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Org00
- *Org01
- *Org02
- *Org03
Does anybody know why I am getting this error ?
I am trying to setup a hyperledger fabric , all from scratch , but I stumbled upon the error above .
George Cosmin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.