区块链教程Fabric1.0源代码分析Proposal(提案)-兄弟连区块链学院

简介:

  区块链教程Fabric1.0源代码分析Proposal(提案),2018年下半年,区块链行业正逐渐褪去发展之初的浮躁、回归理性,表面上看相关人才需求与身价似乎正在回落。但事实上,正是初期泡沫的渐退,让人们更多的关注点放在了区块链真正的技术之上。

Fabric1.0源代码笔记之Proposal(提案)

1、Proposal概述

Proposal,即向Endorser发起的提案。
Proposal代码分布在protos/utils、protos/peer目录下,目录结构如下:

protos/utils目录:
    proputils.go,Proposal工具函数。
    txutils.go,Proposal工具函数。
protos/peer目录:
    proposal.pb.go,Proposal相关结构体定义。

2、Proposal相关结构体定义

_3

2.1、SignedProposal定义

type SignedProposal struct {
    ProposalBytes []byte //Proposal序列化,即type Proposal struct
    Signature []byte //signer.Sign(ProposalBytes)
}
//代码在protos/peer/proposal.pb.go

2.2、Proposal定义

type Proposal struct {
    Header []byte //Header序列化,即type Header struct
    Payload []byte //ChaincodeProposalPayload序列化,即type ChaincodeProposalPayload struct
    Extension []byte //扩展
}
//代码在protos/peer/proposal.pb.go

2.3、ChaincodeProposalPayload定义

type ChaincodeProposalPayload struct {
    Input []byte //ChaincodeInvocationSpec序列化,即type ChaincodeInvocationSpec struct
    TransientMap map[string][]byte //瞬态映射
}
//代码在protos/peer/proposal.pb.go

3、ProposalResponse结构体定义

3.1、ProposalResponse定义

type ProposalResponse struct {
    Version int32
    Timestamp *google_protobuf1.Timestamp
    Response *Response //type Response struct,peer.Response{Status: 200, Message: "OK"}}
    Payload []byte
    Endorsement *Endorsement //type Endorsement struct
}
//代码在protos/peer/proposal_response.pb.go

3.2、Response定义

type Response struct { //peer.Response{Status: 200, Message: "OK"}}
    Status int32
    Message string
    Payload []byte
}
//代码在protos/peer/proposal_response.pb.go

3.3、Endorsement定义

type Endorsement struct {
    Endorser []byte //bccspmsp.signer
    Signature []byte
}
//代码在protos/peer/proposal_response.pb.go
相关文章
|
1月前
|
安全 区块链
区块链积分商城系统开发详细指南//需求功能/指南教程/源码流程
Developing a blockchain points mall system involves multiple aspects such as blockchain technology, smart contracts, front-end development, and business logic design. The following is the general process for developing a blockchain points mall system
|
30天前
|
供应链 区块链 数据安全/隐私保护
探索区块链技术在金融领域的应用与前景分析
本文将深入探讨区块链技术在金融领域的具体应用场景,分析其优势与挑战,并展望未来发展趋势。通过案例分析和技术解析,揭示区块链技术在金融行业中的革新意义及前景。
|
1月前
|
安全 区块链
区块链游戏系统开发步骤需求丨功能逻辑丨规则玩法丨指南教程丨源码详细
Developing blockchain game systems has been a highly anticipated field in recent years. By combining blockchain technology and game mechanics, players can enjoy a brand new gaming experience and higher game credibility.
|
7月前
|
区块链
区块链的发币流程技术分析
区块链现在是发展的如火如荼,很多人都想趁着这个风口,投入区块链创业的浪潮中。 那么我们该怎么做才能抓住这个机会呢? 进行区块链发币要求是很多的,主要有以下几个步骤。
|
7月前
|
安全 算法 区块链
区块链交易所开发技术说明:智能合约设计与实现步骤实现分析
智能合约是区块链技术的核心应用,其能够自动执行、验证和执行合同,并以可验证的方式进行操作。在区块链交易所中,智能合约扮演着重要的角色,它们保证了交易的透明性、效率和安全性。作为一名专业的交易所开发团队一员,在交易所开发这块拥有相对成熟的开发技术,目前已经有成熟的区块链交易所开发案例。本文将介绍如何设计和实现可靠的智能合约来支持区块链交易所。
|
7月前
|
区块链 安全 数据安全/隐私保护
区块链LP流动性SWAP博饼交易所系统开发分析模式
Web3在生态的每一个要素中,都体现出了去中心化的特点。
|
7月前
|
SQL 安全 区块链
交易所系统开发(案例项目)丨区块链交易所系统开发(稳定版)/成熟技术/步骤逻辑/源码教程
The development of a blockchain exchange system involves complex technologies and functions.
|
8月前
|
区块链
区块链DAO众筹资金模式合约开发源代码详情
// 众筹函数,向DAO众筹资金 function contribute() public { uint contributionAmount = (unitPrice * msg.value).div(10 ether); // 计算贡献金额,最小单位为0.01ETH
|
8月前
|
安全 Go 区块链
区块链游戏链游系统开发功能详情丨方案逻辑丨开发项目丨案例分析丨源码规则
 In recent years, with the continuous development of blockchain technology, NFTs (non homogeneous tokens) and DAPPs (decentralized applications) have emerged in the gaming industry.
|
9月前
|
存储 前端开发 JavaScript
区块链交易所系统开发(正式版)丨DEX/DEFI/SWAP去中心化智能合约系统开发详细案例/方案项目/技术分析/源码功能
  去中心化存储技术是一种新型存储技术,它改变了传统的集中式存储技术,将数据从单一位置移到多个位置,这样就消除了存储数据的中心机构或服务器的责任,增加了安全性和数据的有效存储,确保用户的数据安全性。

热门文章

最新文章