2017-10-17 52 views
2

作爲第三方審計人員,我希望通過這些鏈接獲得大量的信息。我想寫我自己的工具,審計物理鏈文件位於:HLF v1.0.2交易日誌(又名連鎖店)的結構

/var/hyperledger/production/ledgersData/chains/chains/<channel_name>/blockfile_* 

在每個peer上。

問:鏈式文件的結構是什麼?

我讀過文檔,找不到關於區塊鏈物理文件結構的任何信息。

回答

1

管理這些文件的軟件包是common/ledger/blkstorage/fsblkstorage軟件包。特別是,blkstorage_serialization.go具有存儲和訪問塊中數據的方法。

type serializedBlockInfo struct { 
    blockHeader *common.BlockHeader 
    txOffsets []*txindexInfo 
    metadata *common.BlockMetadata 
} 

//The order of the transactions must be maintained for history 
type txindexInfo struct { 
    txID string 
    loc *locPointer 
} 

你可能會從開發這個包派生出來的。