当前位置:网站首页>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
边栏推荐
- Biscuits (examination version)
- GAMES202-WebGL中shader的編譯和連接(了解向)
- Drive development - the first helloddk
- 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
- Postman断言
- Postman Association
- What are the advantages of the industry private network over the public network? What specific requirements can be met?
- MPLS experiment
- Programmers' position in the Internet industry | daily anecdotes
- [buuctf.reverse] 159_ [watevrCTF 2019]Watshell
猜你喜欢
Yolov5 tensorrt acceleration
Digital children < daily question> (Digital DP)
GAMES202-WebGL中shader的編譯和連接(了解向)
程序员在互联网行业的地位 | 每日趣闻
Extension of graph theory
Vite configures the development environment and production environment
Postman断言
A blog to achieve embedded entry
Uva1592 Database
RT thread analysis - object container implementation and function
随机推荐
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
Why does MySQL need two-phase commit
C'est un petit résumé de l'étude.
[buuctf.reverse] 159_ [watevrCTF 2019]Watshell
Redis 排查大 key 的4种方法,优化必备
Embedded development program framework
Postman管理测试用例
Nestjs配置文件上传, 配置中间件以及管道的使用
也算是学习中的小总结
Postman Association
Crazy God said redis notes
Finance online homework
The underlying structure of five data types in redis
GAMES202-WebGL中shader的編譯和連接(了解向)
Summary of redis AOF and RDB knowledge points
Raspberry pie 3.5-inch white screen display connection
Selection sort
Orm-f & Q object
Three.js学习-光照和阴影(了解向)
Compilation et connexion de shader dans games202 - webgl (comprendre la direction)