区块链对象及ID - CybexDex/cybex-node-doc GitHub Wiki
我们将简单介绍一下CYBEX对象的有关概念,以便各个客户端在调用之前有一个大致的了解。
石墨烯技术对协议和实现空间的对象进行了区分。在协议层面,有诸如账户、资产、委员会成员、订单、余额等原始对象。而实现层面的对象,则是为了访问更高的抽象层,比如获取数据库当前状态(包括当前区块链全局属性、动态资产数据、事务历史记录、账户统计和预算记录等等)。
CYBEX中的所有标准数据结构都由唯一ID进行标识,ID采用三段式的格式,即xx.xx.xx
:
- 第一段为数据大类,目前仅1/2/3三类ID,其中:
0 ⽬目前仅⽤用来表示撮合成交;
1 表示链上协议中定义的数据结构,⽤用来进⾏交易和操作的验证,钱包与数据库都需遵循该结构;
2 表示系统当前运⾏中所采用的动态数据,不需要在客户端和节点之间进行通讯,仅存在于链上,⽤于执⾏业务 逻辑。如某⼀资产现有的资⾦池状况/智能资产的抵押状况/当前系统的区块数据等。 - 第二段为数据类型;
- 第三段为数据在该类型中的序号。
常用对象列表
ID | 对象类型 |
---|---|
1.1.x | base object |
1.2.x | account object |
1.3.x | asset object |
1.4.x | force settlement object |
1.5.x | committee member object |
1.6.x | witness object |
1.7.x | limit order object |
1.8.x | call order object |
1.9.x | custom object |
1.10.x | proposal object |
1.11.x | operation history object |
1.12.x | withdraw permission object |
1.13.x | vesting balance object |
1.14.x | worker object |
1.15.x | balance object |
2.0.x | global_property_object |
2.1.x | dynamic_global_property_object |
2.3.x | asset_dynamic_data |
2.4.x | asset_bitasset_data |
2.5.x | account_balance_object |
2.6.x | account_statistics_object |
2.7.x | transaction_object |
2.8.x | block_summary_object |
2.9.x | account_transaction_history_object |
2.10.x | blinded_balance_object |
2.11.x | chain_property_object |
2.12.x | witness_schedule_object |
2.13.x | budget_record_object |
2.14.x | special_authority_object |
以下为区块链定义的基础数据ID:
2.0.0(区块链全局参数)
2.1.0(当前区块链数据)
1.2.0(理事会成员账户详细信息)
1.3.0(核心资产,即CYB)
如果需要与石墨烯的C++代码通讯,可以参考以下对象分类:
协议空间的对象
enum graphene::chain::object_type
Values:
null_object_type
base_object_type
account_object_type
asset_object_type
force_settlement_object_type
committee_member_object_type
witness_object_type
limit_order_object_type
call_order_object_type
custom_object_type
proposal_object_type
operation_history_object_type
withdraw_permission_object_type
vesting_balance_object_type
worker_object_type
balance_object_type
OBJECT_TYPE_COUNT
实现空间的对象(2.x.x)
enum graphene::chain::impl_object_type
Values:
impl_global_property_object_type
impl_dynamic_global_property_object_type
impl_reserved0_object_type
impl_asset_dynamic_data_type
impl_asset_bitasset_data_type
impl_account_balance_object_type
impl_account_statistics_object_type
impl_transaction_object_type
impl_block_summary_object_type
impl_account_transaction_history_object_type
impl_blinded_balance_object_type
impl_chain_property_object_type
impl_witness_schedule_object_type
impl_budget_record_object_type
impl_special_authority_object_type
impl_buyback_object_type
impl_fba_accumulator_object_type