Oleg G.
Oleg G.

Reputation: 21

Hyperledger Fabric - Block Inspecting Error

I want to receive a correct block extract containing transaction for a typical invoke transaction (non config transaction).

docker exec peer0.org1.example.com peer channel fetch 4 -c mychannel
docker cp peer0.org1.example.com:/opt/gopath/src/github.com/hyperledger/fabric/peer/mychannel_4.block .
configtxgen -inspectBlock mychannel_4.block > mychannel4.json

This makes it possible to receive a full pb2json decode for the fabric-samples like "first-network". But it doesn't work for the "fabcar" sample. Normally this should work too, right?

Any Ideas why and how to fix it?

../../bin/configtxgen -inspectBlock mychannel_3.block block3.json
2020-06-07 02:05:54.210 PDT [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-06-07 02:05:54.210 PDT [common.tools.configtxgen.localconfig] LoadTopLevel -> PANI 002 Error reading configuration:  Unsupported Config Type ""
2020-06-07 02:05:54.210 PDT [common.tools.configtxgen] func1 -> PANI 003 Error reading configuration:  Unsupported Config Type ""
panic: Error reading configuration:  Unsupported Config Type "" [recovered]
    panic: Error reading configuration:  Unsupported Config Type ""

goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0000c5ce0, 0x0, 0x0, 0x0)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x546
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc000010230, 0x4, 0xc0000416c0, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x101
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(...)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panic(0xc000010238, 0xc0002799e0, 0x1, 0x1)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:73 +0x9a
main.main.func1()
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:260 +0x178
panic(0xde3fc0, 0xc000250a40)
    /w/workspace/fabric-release-jobs-x86_64/golang/go/src/runtime/panic.go:522 +0x1b5
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc0000c5ce0, 0x0, 0x0, 0x0)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x546
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc000010210, 0x4, 0xc0000415c0, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x101
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(...)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panic(0xc000010218, 0xc000279df8, 0x2, 0x2)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:73 +0x9a
github.com/hyperledger/fabric/common/tools/configtxgen/localconfig.LoadTopLevel(0x0, 0x0, 0x0, 0x1)
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/localconfig/config.go:234 +0x3fe
main.main()
    /w/workspace/fabric-release-jobs-x86_64/gopath/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:278 +0xfb5

Upvotes: 0

Views: 178

Answers (1)

Chintan Rajvir
Chintan Rajvir

Reputation: 709

You can make use of configtxlator tool to decode the block as a whole.

configtxlator proto_decode --type=common.Block --input=<your_block.pb> --output=<your_block.json>

Upvotes: 1

Related Questions