2017-10-17 4 views
2

제 3 자 감사인으로서 블록의 해시를 체인에 매우 적합하게하고 싶습니다. 각 피어에있는 물리적 체인 파일을 감사하는 자체 도구를 작성하고 싶습니다.HLF v1.0.2 트랜잭션 로그 구조 (a.k.a 체인)

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

Q : 체인 파일의 구조는 무엇입니까?

설명서를 읽었으므로 블록 체인 실제 파일의 구조와 관련된 정보를 찾을 수 없습니다.

답변

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 
} 

이 패키지에서 파생 된 뭔가를 개발할 수 있습니다.