天玄技术文档
  • 平台介绍
    • 天玄区块链
    • 版本信息
  • 快速开始
    • 快速搭建天玄链
      • 硬件要求
      • 软件要求
      • 构建节点安装包
      • 安装并启动节点
    • 应用部署示例
  • 安装手册
    • 天玄链
      • 打包可执行文件
      • 安装
      • 配置说明
      • 证书说明
      • 日志说明
    • 天玄网关
      • 安装
      • 配置说明
  • 应用开发手册
    • 创建和使用账户
    • 智能合约
    • Java SDK
      • 快速入门
      • 配置说明
      • 远程调用接口
    • 天玄链功能接口列表
  • 系统架构
    • 整体架构
    • 天玄链交易流程
    • 数据结构&编码
    • 核心模块
      • 共识算法
      • P2P网络
      • 交易并行
      • 存储
      • 流水线执行
      • CA机制
      • 网关
      • 虚拟机
      • 密码
  • 社区
    • 团队介绍
    • 合作伙伴
    • 社群入口
Powered by GitBook
On this page
  • 交易数据(EthTransaction)
  • 区块数据(Block)
  • 全局系统事件数据(globalEvent)
  • 交易收据数据(EthTransactionReceipt)
  • 合约事件数据(LogInfo)
  1. 系统架构

数据结构&编码

区块链中,交易、收据、区块是三种重要的数据结构,是外界与区块链系统沟通的一种数据格式。

而天玄中,对以太坊原有的数据格式上新增了天玄必备的数据字段。如下:

交易数据(EthTransaction)

名称
类型
描述
RLP编码索引

publicKey

bytes20

交易发起公钥

0

nonce

u256

nonce值,标识当前交易执行的唯一性

1

futureEventNumber

u256

系统查重使用

2

gasPrice

u256

gas价格,天玄中暂未启用

3

gasLimit

u256

gas限制,当前交易执行的gas消耗上限,天玄中暂无启用

4

receiveAddress

bytes20

调用地址,交易调用的接收地址

5

value

u256

当前交易的转账数额,天玄中暂未启用

6

data

vector<byte>

调用内容,若receiveAddress=0x0,则为合约代码;否则为合约方法的函数签名

7

executeStates

set<byte>

读写状态,当前交易涉及读、写的状态集合

8

signature

vector<byte>

交易发起者签名

9

区块数据(Block)

名称
类型
描述
RLP编码索引

eventId

bytes32

当前区块内容哈希,构建链式数据

0

preEventId

bytes32

上一个区块内容哈希,构建链式数据

1

coinBase

btyes0

矿工地址,天玄中暂未启用

2

stateRoot

bytes0

状态跟,天玄中暂未启用

3

receiptsRoot

bytes0

收据根,天玄中暂未启用

4

epoch

u256

世代号,标记当前验证者集合所处时间单位

5

number

u256

区块号,标记当前区块的高度

6

timestamp

u256

时间错,标记当前区块的出块时间

7

globalEvents

vector<globalEvent>

全局事件,当前区块内包含的系统更新事件

8

receipts

vector<EthTransactionReceipt>

交易收据,当前区块内包含交易的所有执行后收据

9:receipts size

10:receipts[0]

11:receipts[1]

...

全局系统事件数据(globalEvent)

名称
类型
描述
RLP编码索引

publicKey

vector<byte>

全局交易发起者公钥

0

nonce

u256

nonce值,标识当前交易执行的唯一性

1

futureEventNumber

u256

系统查重使用

2

commandCode

byte

系统事件指令

3

data

vector<byte>

调用内容,系统事件携带参数

4

signature

vector<byte>

交易发起者签名

5

交易收据数据(EthTransactionReceipt)

名称
类型
描述
RLP编码索引

logInfoList

vector<LogInfo>

event事件列表

0

ethTransaction

EthTransaction

交易内容,产生收据的交易内容

1

gasUsed

u256

gas消耗

2

executionResult

vector<byte>

执行结果,当前交易的执行结果

3

error

string

错误日志,标记当前交易执行错误原因

4

合约事件数据(LogInfo)

名称
类型
描述
RLP编码索引

address

btyes20

合约地址

0

topics

vector<word>

事件主题

1

data

vector<byte>

事件内容

2

Previous天玄链交易流程Next核心模块

Last updated 8 months ago