Hyperledger Fabric:“订购者”具有无效的密钥:EtcdRaft

时间:2019-03-05 19:33:37

标签: hyperledger-fabric

在使用官方Hyperledger回购中的configtx.yaml时,尝试创建创世块时出现以下错误:

root@774983db9864:/home# configtxgen -profile OrgsOrdererGenesis -outputBlock genesis.block -channelID 4chan
2019-03-05 19:25:44.240 UTC [common/tools/configtxgen] main -> INFO 001 Loading configuration
2019-03-05 19:25:44.261 UTC [common/tools/configtxgen/localconfig] Load -> CRIT 002 Error unmarshaling config into struct:  2 error(s) decoding:

* 'Orderer' has invalid keys: EtcdRaft
* 'Profiles[OrgsOrdererGenesis].Orderer' has invalid keys: EtcdRaft
2019-03-05 19:25:44.262 UTC [common/tools/configtxgen] func1 -> CRIT 003 Error unmarshaling config into struct: 2 error(s) decoding:

* 'Orderer' has invalid keys: EtcdRaft
* 'Profiles[OrgsOrdererGenesis].Orderer' has invalid keys: EtcdRaft
panic: Error unmarshaling config into struct: 2 error(s) decoding:

* 'Orderer' has invalid keys: EtcdRaft
* 'Profiles[OrgsOrdererGenesis].Orderer' has invalid keys: EtcdRaft [recovered]
    panic: Error unmarshaling config into struct: 2 error(s) decoding:

* 'Orderer' has invalid keys: EtcdRaft
* 'Profiles[OrgsOrdererGenesis].Orderer' has invalid keys: EtcdRaft

goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/github.com/op/go-logging.(*Logger).Panic(0xc420195e00, 0xc420523560, 0x1, 0x1)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/op/go-logging/logger.go:188 +0xbd
main.main.func1()
    /opt/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:254 +0x1ae
panic(0xc6ea00, 0xc420523550)
    /opt/go/src/runtime/panic.go:505 +0x229
github.com/hyperledger/fabric/vendor/github.com/op/go-logging.(*Logger).Panic(0xc420195c50, 0xc42054e120, 0x2, 0x2)
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/op/go-logging/logger.go:188 +0xbd
github.com/hyperledger/fabric/common/tools/configtxgen/localconfig.Load(0x7fffbcd538da, 0x12, 0x0, 0x0, 0x0, 0xc4201b3540)
    /opt/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/localconfig/config.go:284 +0x607
main.main()
    /opt/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:265 +0xce7

请问该如何解决?

2 个答案:

答案 0 :(得分:0)

解决方案是删除EtcdRaft部分,因为Hyperledger Fabric v1.3或1.4中尚未实现基于Raft的共识。回购中的configtx.yaml不应包含此部分。

答案 1 :(得分:0)

SampleMultiNodeEtcdRaft:
    <<: *ChannelDefaults
    Capabilities:
        <<: *ChannelCapabilities
    Orderer:
        <<: *OrdererDefaults
        OrdererType: etcdraft
        EtcdRaft:
            Options:
              TickInterval: 500ms
              ElectionTick: 10
              HeartbeatTick: 1
              MaxInflightBlocks: 5
              SnapshotIntervalSize: 20971520
            Consenters:

...