invoke操作流程及block生成
主要分析invoke操作的执行流程及主要涉及的函数,以及block的生成,相关block字段的含义等。该例主要分析kafka共识模块, invoke的主要执行流程如下图所示,主要步骤有:
1、SDK或者Client发起invoke操作,调用ChaincodeInvokeOrQuery(),创建Proposal,
该过程主要生成txid,构造出channelHeader,赋值给proposal.header, 构造出ChaincodeProposalPayload赋值给proposal.payload, proposal结构如下所示。然后对proposal进行签名获得signedproposal。
type Proposal struct {
// The header of the proposal. It is the bytes of the Header
Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
// The payload of the proposal as defined by the type in the proposal
// header.
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
// Optional extensions to the proposal. Its content depends on the Header's
// type field. For the type CHAINCODE, it might be the bytes of a