当前位置:网站首页>Hyperledger Fabric2. Some basic concepts of X (1)
Hyperledger Fabric2. Some basic concepts of X (1)
2022-07-06 04:59:00 【JasonCeng_】
▲ Click on 101 Chain horizon , Pay attention not to lose
Hello everyone , I'm a Chuang , This is my number 30 Original articles .
I prefer reading ,2021 My reading volume in the whole year is about 20+ This book , Covering law 、 philosophy 、 technology 、 The humanities .
But the reading volume will feel , Simply reading is actually avoiding , So I decided to sort out my reading and thinking , Write something helpful for everyone .
Recently, I have been thinking about my core competitiveness , I found that we still need to focus on the field of Technology , After a period of groping , Decide to focus on in the near future Fabric Source code , Write a series of articles .
Although there are many interpretations on the Internet Fabric Source blog , But I hope to write something different . I once listened to teacher Zhang Yu's class , He introduced Mr. Hua Luogeng Once said a sentence :“ Count without intuition , It's hard to be subtle when there are few forms .”
I agree with this sentence very much , Therefore, I also want to dare to use charts and words to express my thoughts , Hope for you , It helps me .
This series will use Hyperledger Fabric2.x Analysis based on series .
Fabric The first article of source code interpretation , Titled :《Hyperledger Fabric2.x One of some basic concepts of ( One )》, This paper mainly introduces transaction 、 block Two concepts .
transaction (Transaction, Or transaction ) yes Fabric Core concept of , It usually refers to calling chain code ( Intelligent contract ) An operation to change the ledger status data .
The change of ledger status is described by the transaction result read-write set , Gather transactions through Orderer The nodes are sorted and packed into blocks according to rules .


(1) Ordinary transaction messages encapsulate the execution transaction results of changing the ledger status , It needs to be sorted and packaged into blocks .

(2) The configuration transaction message is used to create a new application channel or update the channel configuration , It is usually packaged into blocks after sorting , At the same time, update the latest configured block number to the latest block metadata to facilitate index search .

block (Block) Refers to a collection of transactions that occur over a period of time , After sorting, package according to rules and add signatures 、 Hash value 、 Data structure composed of timestamp and other metadata .

Blockchain is a chained data structure based on blocks and connected in chronological order .

Fabric Block structure in (Block type ) Including the block head Header、 Transaction data set Data And block metadata Metadata Three parts .

(1) Block head Header Encapsulated block number 、 Hash value of the previous block 、 Hash value of current block
(2) Transaction data set Data Encapsulates the packaged transaction set
(3) Block metadata Metadata Encapsulated as follows 4 Metadata index entries :
BlockMetadataIndex_SIGNATURES: Block signature ;
BlockMetadataIndex_LAST_CONFIG: Block number of the latest configured block ;
BlockMetadataIndex_TRANSACTIONS_FILTER: Latest transaction filter , Encapsulates the transaction data set Data Transaction verification code corresponding to all transactions in , Identify the validity of their transactions .
BlockMetadataIndex_ORDERER:Orderer Configuration information , Such as Kafka Initialization parameters of consensus component .
actually , The real block data structure is much more complex than the above figure , The right of this article should be a good introduction , Lay the foundation for the in-depth introduction later .
Release here Fabric Code of block data structure :github.com/hyperledger/fabric-protos-go/common/common.pb.go
// This is finalized block structure to be shared among the orderer and peer
// Note that the BlockHeader chains to the previous BlockHeader, and the BlockData hash is embedded
// in the BlockHeader. This makes it natural and obvious that the Data is included in the hash, but
// the Metadata is not.
type Block struct {
Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
Data *BlockData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
Metadata *BlockMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
We look forward to working together in the future fabric In depth analysis of block data structure , It's like peeling an onion , Step by step , from the shallower to the deeper
If you think it's well written
Please give me a compliment ~
Pay attention to me , Take you to the blockchain industry
Recommended reading :
1、 A useful multi-party privacy intersection algorithm library MultipartyPSI-Pro
4、Web3 What does it mean for us ordinary people ?
5、 What is the latest hot digital collection ?
6、《 Blockchain is a trusted infrastructure for building industrial Internet 》
7、《 Thinking about the layout of privacy Computing 》
8、 read |《 Data asset theory 》: How to capitalize data ?
People who see the future in advance ,
And spend a lifetime can't see clearly ,
Destine is a very different fate .
Click on the card below to follow 101 Chain horizon ******, and 1000+ readers Together **
Insight into the nature of Technology


101 Chain horizon
Blockchain 、 Professional knowledge sharing in the field of privacy computing and fintech .
29 Original content
official account
▲ Click on the card above to follow 101 Chain horizon , Insight into the nature of Technology
Technical communication | Industry Research Report | Frontier insight | Reprint Kaibai | Join the community
Please reply in official account. cooperation
Welcome to share the article to the circle of friends
边栏推荐
- RT thread analysis - object container implementation and function
- Three.js学习-光照和阴影(了解向)
- 程序员在互联网行业的地位 | 每日趣闻
- Use sentinel to interface locally
- Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
- Leetcode dynamic planning day 16
- Summary of redis AOF and RDB knowledge points
- Fuzzy -- basic application method of AFL
- 优秀PM必须经历这3层蜕变!
- Postman管理测试用例
猜你喜欢

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

Golang -- TCP implements concurrency (server and client)

RTP GB28181 文件测试工具

Postman管理测试用例

Use sentinel to interface locally

Cve-2019-11043 (PHP Remote Code Execution Vulnerability)

Postman前置脚本-全局变量和环境变量

Simple understanding of interpreters and compilers

Weng Kai C language third week 3.1 punch in
![[数学建模] 微分方程--捕鱼业的持续发展](/img/7c/2ab6f2a34bc2c97318537ec8e0b0c5.png)
[数学建模] 微分方程--捕鱼业的持续发展
随机推荐
Biscuits (examination version)
内核判断i2c地址上是否挂载外设
JS quick start (II)
Postman manage test cases
Drive development - the first helloddk
关于Unity Inspector上的一些常用技巧,一般用于编辑器扩展或者其他
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
项目经理,你会画原型嘛?项目经理需要做产品设计了?
[lgr-109] Luogu may race II & windy round 6
Ue5 small knowledge points to enable the setting of lumen
yolov5 tensorrt加速
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
SQL injection vulnerability (MSSQL injection)
Ad20 is set with through-hole direct connection copper sheet, and the bonding pad is cross connected
idea一键导包
ISP learning (2)
最高法院,离婚案件判决标准
The video in win10 computer system does not display thumbnails
2021RoboCom机器人开发者大赛(初赛)
Collection + interview questions