Documentation ¶
Index ¶
- func DeserializeBlock(serializedBlock []byte) (*storePb.BlockWithRWSet, error)
- func DeserializeMeta(serializedBlock []byte) (*storePb.SerializedBlock, error)
- 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
func DeserializeMeta ¶ added in v2.2.0
func DeserializeMeta(serializedBlock []byte) (*storePb.SerializedBlock, error)
反序列化 meta 数据
Types ¶
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 //整个Block+RWSet序列化后存储的位置 Index *storePb.StoreInfo //Block基本信息(storePb.SerializedBlock)序列化后存储的位置 MetaIndex *storePb.StoreInfo //交易列表序列化后的存储位置 TxsIndex []*storePb.StoreInfo //读写集序列化后存储的位置 RWSetsIndex []*storePb.StoreInfo }
BlockWithSerializedInfo contains block,txs and corresponding serialized data
func NewBlockSerializedInfo ¶ added in v2.2.0
func NewBlockSerializedInfo() *BlockWithSerializedInfo
创建一个序列化对象
func SerializeBlock ¶
func SerializeBlock(blockWithRWSet *storePb.BlockWithRWSet) ([]byte, *BlockWithSerializedInfo, error)
SerializeBlock serialized a BlockWithRWSet and return serialized data which combined as a BlockWithSerializedInfo
func (*BlockWithSerializedInfo) ReSet ¶ added in v2.2.0
func (b *BlockWithSerializedInfo) ReSet()
为sync.pool 重置 BlockWithSerializedInfo 状态时使用
func (*BlockWithSerializedInfo) SerializeEventTopicTable ¶ added in v2.2.0
func (b *BlockWithSerializedInfo) SerializeEventTopicTable(buf *proto.Buffer) error
序列化ContractEvents信息
func (*BlockWithSerializedInfo) SerializeMeta ¶ added in v2.2.0
func (b *BlockWithSerializedInfo) SerializeMeta(buf *proto.Buffer) error
序列化meta信息,主要包括 header,dag,txids,additionalData数据
func (*BlockWithSerializedInfo) SerializeTxRWSets ¶ added in v2.2.0
func (b *BlockWithSerializedInfo) SerializeTxRWSets(buf *proto.Buffer) error
序列化读写集
func (*BlockWithSerializedInfo) SerializeTxs ¶ added in v2.2.0
func (b *BlockWithSerializedInfo) SerializeTxs(buf *proto.Buffer) error
序列化txs信息
Click to show internal directories.
Click to hide internal directories.