sample_chain/document/客户端至peer节点.md

19 lines
707 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.

### 客户端至peer节点
1.生成随机的交易提案参数args模拟客户端的交易提案
2.把args放入pb.ChaincodeInput结构体中
3.获取链码ID根据链码ID实例化pb.ChaincodeSpec结构体
4.获取一个随机数对随机数nonce和序列化后的用户身份creator进行hash运算得到txid
5.根据nonce和creator实例化pb.SignatureHeader结构体
6.序列化pb.ChaincodeSpec结构体对象和pb.SignatureHeader结构体对象分别得到得到cisByteshdrBytes
7.根据cisBytes和hdrBytes实例化pb.Proposal结构体
8.序列化pb.Proposal结构体对象并对该对象签名实例化pb.SignedProposal结构体
7.实例化pb.ChaincodeMessage结构体