Conflux 对接 Q&A

信息 内容
官网地址 https://confluxnetwork.org/
币种简称,全称 CFX
区块浏览器地址 https://www.confluxscan.io/
Conflux Tethys网络 chain_id 1029
Testnet chain_id 1
公共RPC节点url(支持新的CIP37地址) 主网: https://main.confluxrpc.com测试网https://test.confluxrpc.comConflux公共rpc文档https://github.com/conflux-fans/conflux-rpc-endpoints目前不保证服务可用性,仅供开发者测试使用
Github源码地址:Fullnode https://github.com/Conflux-Chain/conflux-rust
java sdk https://github.com/Conflux-Chain/java-conflux-sdk
js sdk https://github.com/Conflux-Chain/js-conflux-sdk
go sdk https://github.com/Conflux-Chain/go-conflux-sdk
全节点配置文件 http://developer.confluxnetwork.org/docs/apis/en/node_config_example
主网节点安装指导 Conflux Tethys GPU Mining Instruction (v1.1.6-fix)
目前主网的数据占用磁盘空间大小 Full node: 200GB
主网数据快照地址(用于加速同步,如果有请提供) /
出块速度 0.5s per block
确认规则 RPC now provides two ports for confirmation:
1. https://developer.conflux-chain.org/docs/conflux-doc/docs/json_rpc#cfx_getconfirmationriskbyhash.
if return_value/(2^256) <= 1/10^8, it indicates confirmation and returns the integer confirmation risk, which is also the probability of pivot chain switch.
2. https://developer.conflux-chain.org/docs/conflux-doc/docs/json_rpc#cfx_epochnumbe
This RPC corresponds to “latest_confirmed”, it returns the latest confirmed integer epoch number. It indicates confirmation if this epoch is greater or equal to what you last saw in exchange. The internal logic is the same behind both methods.
币种精度 The minimum unit is drip, 1 drip = 1/10^18 CFX
存储交易索引,以便通过RPC访问历史数据 1. locate “tethys.toml”, add “persist_tx_index=true”
2. conflux --config tethys.toml
如何配置节点的rpc端口和数据存放路径 HTTP RPC端口在toml配置文件里通过jsonrpc_tcp_port指定,其它还有jsonrpc_ws_port、jsonrpc_tcp_port、jsonrpc_http_port、jsonrpc_local_tcp_port、jsonrpc_local_http_port。可以参考release里提供的tethys.toml默认配置文件。默认的数据存放在运行路径(pwd)下的blockchain_db和storage_db里。可以通过配置文件里的conflux_data_dir和block_db_dir分别配置。需要注意如果需要访问老的receipt数据的话,需要把persist_tx_index设置为true.
rpc/sdk文档链接 Conflux sdk文档:https://developer.conflux-chain.org/
Conflux公共rpc文档:https://github.com/conflux-fans/conflux-rpc-endpoints
Fullnode RPC规范 JSON RPC 2.0
获取当前的最新块高 cfx_epochNumber
获取某个块的所有交易 cfx_getBlockByHash
获取某一笔交易详情 cfx_getTransactionByHash
如何判断一笔交易的准确性,避免假充值(文字说明即可) 通过cfx_getConfirmationRiskByHash获取交易所在block的确认安全程度,这个值除以2^256得到被revert的概率。一般对于小额资金,revert概率低于1/10^8即可,若资金更大,适当调低这个目标概率值即可。
转账: 最好是离线签名+在线广播的方式 1)通过SDK相关API来签名,具体参考:https://developer.conflux-chain.org/
2)发送/广播交易:cfx_sendRawTransaction;
查询地址余额 cfx_getBalance
主链分叉的预防措施 Conflux采用树图账本结构,账本中几乎所有的诚实区块均为有效区块。其采用GHAST共识算法(最重子树规则)来防止双花攻击。其安全性假设是诚实节点的算力超过50%。
存储过去更长时间的状态 默认参数只存储最近约4000 epoch的状态,需要查询更老的状态的话需要配置additional_maintained_snapshot_count。
设置为100大概可以存储最近两天的状态。
由于请求的状态太老,导致的常见报错类似 “State for epoch (number=… hash=…) does not exist: out-of-bound…”
2 Likes