当前位置:网站首页>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
边栏推荐
- The kernel determines whether peripherals are attached to the I2C address
- Excellent PM must experience these three levels of transformation!
- Vite configures the development environment and production environment
- Three.js学习-光照和阴影(了解向)
- Three. JS learning - light and shadow (understanding)
- Redis 排查大 key 的4种方法,优化必备
- [try to hack] John hash cracking tool
- Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
- Supreme Court, judgment standard of divorce cases
- RT thread analysis log system RT_ Kprintf analysis
猜你喜欢

Codeforces Round #804 (Div. 2)

What are the advantages of the industry private network over the public network? What specific requirements can be met?

Programmers' position in the Internet industry | daily anecdotes

RTP gb28181 document testing tool

二叉树基本知识和例题

A blog to achieve embedded entry

Postman断言

麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东

RT thread analysis log system RT_ Kprintf analysis

GAMES202-WebGL中shader的编译和连接(了解向)
随机推荐
Flink kakfa data read and write to Hudi
SQL注入漏洞(MSSQL注入)
Introduction of several RS485 isolated communication schemes
Application of Flody
集合详解之 Map + 面试题
Some common skills on unity inspector are generally used for editor extension or others
Postman前置脚本-全局变量和环境变量
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
Hometown 20 years later (primary school exercises)
Basic knowledge and examples of binary tree
JS quick start (II)
EditorUtility.SetDirty在Untiy中的作用以及应用
Three.js学习-光照和阴影(了解向)
Postman test report
[buuctf.reverse] 159_ [watevrCTF 2019]Watshell
Rce code and Command Execution Vulnerability
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
Uva1592 Database
[detailed steps of FreeRTOS shift value for the first time]
Set detailed map + interview questions