Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 如何阅读blcokfile_xxxx_Database_Hyperledger Fabric - Fatal编程技术网

Database 如何阅读blcokfile_xxxx

Database 如何阅读blcokfile_xxxx,database,hyperledger-fabric,Database,Hyperledger Fabric,我试图读取fabric生成的块文件00000,它位于对等节点的/var/hyperledger/production/ledgersData/chains/chains/mychannel目录下。 但我无法通过以下方法阅读: configtxgen-profile TwoOrgsChannel-inspectBlock./channel artifacts/blockfile\u000000 错误是 [common/tools/configtxgen]main->inspectBlock上

我试图读取fabric生成的块文件00000,它位于对等节点的/var/hyperledger/production/ledgersData/chains/chains/mychannel目录下。 但我无法通过以下方法阅读:

configtxgen-profile TwoOrgsChannel-inspectBlock./channel artifacts/blockfile\u000000

错误是

[common/tools/configtxgen]main->inspectBlock上的CRIT 004错误:无法读取块/通道工件/块文件\u000000

使用confitxlator

configtxlator proto_decode--输入./channel artifacts/blockfile_u000000--键入common.Block

错误是

configtxlator:错误:错误解码:错误解组:proto:无法跳过公共块的未知导线类型6
我知道区块文件实际上是区块,区块是区块的集合,如何处理


配置TXLATOR版本
配置TXLATOR:
版本:1.2.0
提交SHA:f6e72eb
Go版本:go1.10
OS/Arch:linux/amd64

任何帮助都将不胜感激


我使用docker exec命令进入对等节点,并通过对等通道获取块。然后,通过configtxlator读取块。但是如何读取交易信息

零件日志为(块6):

“标题”:{
“数据散列”:“kVFRQLFjY7+6l6QsL+jOgt5ICoCUlRG4VedgmBXv/mE=”,
“编号”:“6”,
“上一个散列”:“GQ4w7x7MQB+Jvsa3neJcTNdU7aXdKVHySA7Va3SktOs=”
},

configtxgen和configtxlator分别用于生成配置事务和将配置事务转换为可读格式。配置事务包括创建通道、更新通道中的锚节点、设置通道的读写器等。它们不适用于存储在块文件_xxx中的正常事务


您可以使用Hyperledger Explorer查看区块数据。

有一些API可用于查询任何给定通道的区块:

GetChainInfo
返回给定通道的当前块高度

GetBlockByNumber
按编号返回各个块(从那里向后从GetChainInfo API获取最新的块)


所有SDK都有调用这些API的方法

谢谢您的回答。但让任何工具读取它,因为我不能在1.2.0映像中使用Hyperledger Explorer。我使用docker exec命令进入对等节点,并通过对等通道获取块。然后,通过configtxlator读取块。但是如何读取交易信息。好的。我明白了:)根据Jason Yellick的这条消息,我们不能用configtxlator解码“块文件”而不是一个接一个地获取分类账块并分别解码每个人吗?