当前位置:网站首页>Source code analysis of Chang'an chain data storage
Source code analysis of Chang'an chain data storage
2022-07-27 20:07:00 【Handsome Wutong】
summary
The enclosure is responsible for persisting blocks on the storage chain 、 transaction 、 state 、 Historical read / write sets and other ledger data , And provide the query function of the above data . Blockchain conducts batch data submission in blocks , One block submission will involve the submission of multiple ledger data , such as : Transaction submission , Status data modification, etc , Therefore, the storage module needs to maintain the atomicity of ledger data . Chang'an chain supports common databases to store ledger data , Such as LevelDB、BadgerDB、TikvDB、MySQL Such as the database , The business can choose any database to deploy the blockchain .
The ledger data is mainly divided into 5 class :
Block data , Record block meta information and transaction data :
Block metadata includes : Block head 、 block DAG、 Trading in the block txid list ,additionalData etc. ;
Trading data , That is, the serialized transaction body , To provide query of single transaction data , Therefore, the transaction data is stored separately .
Status data , Record the online status data read and written in the smart contract , The state of the world .
The historical data , Chang'an chain has a history of state changes during the execution of each transaction 、 Contract call history 、 The transaction history initiated by the account can be recorded , It can be used for subsequent retrospective transactions 、 The transition process of state data .
Contract execution result read / write set data , Chang'an chain has separately saved the read and write status data set of each transaction during execution , It is convenient for other nodes to synchronize data quickly .
Event data , Event log generated during contract execution

To be improved
边栏推荐
猜你喜欢

2022爱分析·智慧社区厂商全景报告 厂商征集

真实案例,大学生接单被骗,希望大家不要被骗了【惨痛教训】

Togglebutton (button switch)

focal loss

New library online | cnopendata detailed address data of all patents in China

第3章 基本操作

Underlying principle of mvcc

mysql函数汇总之系统信息函数

GLTF模型添加关节控制

Adults have only one main job, but they have to pay a price. I was persuaded to step back by personnel, and I cried all night
随机推荐
2022年,软件测试还能学吗?别学了,软件测试岗位饱和了...
会员卡头部组件使用文档
cesium基本控件介绍
New library online | cnopendata detailed address data of all patents in China
内置模块10.18
C193:评分系统
使用VS编译NCNN
VALN 11.9
Compiling ncnn with vs
Common operators 9.21
How to encrypt the data in MySQL database? Mysql8.0 comes with new features
1.2、基于增量式生成遮挡与对抗抑制的行人再识别(代码理解与实验进度+报告)
C background GC cause and effect
[C # network application programming] Experiment 3: process management exercise
Acwing 692. g bus count difference + prefix and
Qtexttospeech class of QT realizes voice broadcast function
顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
How powerful can top "hackers" be? Internet access without signal, expert: high-end operation!
Adults have only one main job, but they have to pay a price. I was persuaded to step back by personnel, and I cried all night
DCM11- 根据标识符写入数据服务 ($2E)的功能和配置【基于DaVinci Configurator Classic】