Documentation ¶
Index ¶
- func DeserializeBlock(serializedBlock []byte) (*storePb.BlockWithRWSet, error)
- func DeserializeMeta(serializedBlock []byte) (*storePb.SerializedBlock, error)
- type BlockIndex
- type BlockIndexMeta
- type BlockWithSerializedInfo
- func (b *BlockWithSerializedInfo) ReSet()
- func (b *BlockWithSerializedInfo) SerializeEventTopicTable(buf *proto.Buffer) error
- func (b *BlockWithSerializedInfo) SerializeMeta(buf *proto.Buffer) error
- func (b *BlockWithSerializedInfo) SerializeTxRWSets(buf *proto.Buffer) error
- func (b *BlockWithSerializedInfo) SerializeTxs(buf *proto.Buffer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeBlock ¶
func DeserializeBlock(serializedBlock []byte) (*storePb.BlockWithRWSet, error)
DeserializeBlock returns a deserialized block for given serialized bytes @Description: @param serializedBlock @return *storePb.BlockWithRWSet @return error
func DeserializeMeta ¶
func DeserializeMeta(serializedBlock []byte) (*storePb.SerializedBlock, error)
DeserializeMeta 反序列化 meta 数据 @Description: @param serializedBlock @return *storePb.SerializedBlock @return error
Types ¶
type BlockIndex ¶ added in v3.0.1
type BlockIndex struct { //整个Block+RWSet序列化后存储的位置 Index *storePb.StoreInfo //Block基本信息(storePb.SerializedBlock)序列化后存储的位置 MetaIndex *storePb.StoreInfo //交易列表序列化后的存储位置 TxsIndex []*storePb.StoreInfo //读写集序列化后存储的位置 RWSetsIndex []*storePb.StoreInfo }
BlockIndex file block's block index detail @Description:
type BlockIndexMeta ¶ added in v3.0.1
type BlockIndexMeta struct { Height uint64 BlockTimestamp int64 BlockHash []byte TxIds []string RwSets []string BlockIndex }
BlockIndexMeta add next time @Description:
type BlockWithSerializedInfo ¶
type BlockWithSerializedInfo struct { Block *commonPb.Block Meta *storePb.SerializedBlock // Block without Txs SerializedMeta []byte Txs []*commonPb.Transaction SerializedTxs [][]byte TxRWSets []*commonPb.TxRWSet SerializedTxRWSets [][]byte ContractEvents []*commonPb.ContractEvent SerializedContractEvents [][]byte BlockIndex }
BlockWithSerializedInfo contains block,txs and corresponding serialized data @Description:
func NewBlockSerializedInfo ¶
func NewBlockSerializedInfo() *BlockWithSerializedInfo
NewBlockSerializedInfo 创建一个序列化对象 @Description: @return *BlockWithSerializedInfo
func SerializeBlock ¶
func SerializeBlock(blockWithRWSet *storePb.BlockWithRWSet) ([]byte, *BlockWithSerializedInfo, error)
SerializeBlock serialized a BlockWithRWSet and return serialized data which combined as a BlockWithSerializedInfo @Description: @param blockWithRWSet @return []byte @return *BlockWithSerializedInfo @return error
func (*BlockWithSerializedInfo) ReSet ¶
func (b *BlockWithSerializedInfo) ReSet()
ReSet 为sync.pool 重置 BlockWithSerializedInfo 状态时使用 @Description: @receiver b
func (*BlockWithSerializedInfo) SerializeEventTopicTable ¶
func (b *BlockWithSerializedInfo) SerializeEventTopicTable(buf *proto.Buffer) error
SerializeEventTopicTable 序列化ContractEvents信息 @Description: @receiver b @param buf @return error
func (*BlockWithSerializedInfo) SerializeMeta ¶
func (b *BlockWithSerializedInfo) SerializeMeta(buf *proto.Buffer) error
SerializeMeta 序列化meta信息,主要包括 header,dag,txids,additionalData数据 @Description: @receiver b @param buf @return error
func (*BlockWithSerializedInfo) SerializeTxRWSets ¶
func (b *BlockWithSerializedInfo) SerializeTxRWSets(buf *proto.Buffer) error
SerializeTxRWSets 序列化读写集 @Description: @receiver b @param buf @return error
func (*BlockWithSerializedInfo) SerializeTxs ¶
func (b *BlockWithSerializedInfo) SerializeTxs(buf *proto.Buffer) error
SerializeTxs 序列化txs信息 @Description: @receiver b @param buf @return error