sample_chain/document/将封装好的交易交给Order节点排序.md

13 lines
862 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 将封装好的交易交给Order节点排序
1.分析交易直接的依赖关系,将有依赖关系的两笔交易添加到事务组中(TransactionGroup),并删除不可序列化的交易
2.判断当前区块大小是否达到阈值、时间间隔是否超出阈值,确定是否满足成块条件
3.通过交易之间的依赖关系创建拓扑图并对交易进行拓扑排序将每10笔交易封装至信封中(Envelope),并返回信封切片
4.将信封切片序列化并填充至Block结构体中的BlockData字段将负载Block.Data的内容使用用SHA256算法生成摘要值
5.获得区块头(Block.Header)的字节数组并使用Order节点的私钥对该字节数组签名得到的签名结果以及签名者的身份信息放入区块的元数据(BlockMetadata)中
6.将区块写入到账本数据库中(leveldb)