跳到主要内容

JSON-RPC 的兼容性

Conflux eSpace 实现了 Web3 JSON-RPC 协议。

查看以下视频以快速了解这个主题:

方法

方法状态备注
web3_clientVersion
net_version
eth_protocolVersion
eth_chainId
eth_gasPrice
eth_blockNumber
eth_getBalance
eth_getStorageAt
eth_getCode
eth_getTransactionCount
eth_sendRawTransaction
eth_submitTransaction
eth_call
eth_estimateGas
eth_getTransactionByHash
eth_getTransactionReceipt
eth_getLogsfromBlock 与 toBlock 的差值最大限制为1000
eth_getBlockByHash
eth_getBlockByNumber
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_syncing
eth_hashrate
eth_coinbase
eth_mining
eth_maxPriorityFeePerGas
eth_accounts
eth_submitHashrate
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getUncleCountByBlockHash
eth_getUncleCountByBlockNumber
parity_getBlockReceipts
eth_pendingTransactions🚧
web3_sha3🚧
trace_blockParity RPC
trace_filterParity RPC
trace_transactionParity RPC
eth_feeHistorySupported at v2.4.0
eth_getFilterChanges在v2.1.1版本中支持
eth_getFilterLogs在v2.1.1版本中支持
eth_newBlockFilter在v2.1.1版本中支持
eth_newFilter在v2.1.1版本中支持
eth_newPendingTransactionFilter在v2.1.1版本中支持
eth_uninstallFilter在v2.1.1版本中支持
debug_traceTransactionSupported at v2.4.0
debug_traceBlockByHashSupported at v2.4.0
debug_traceBlockByNumberSupported at v2.4.0
net_listening
net_peerCount
eth_compileLLL
eth_compileSerpent
eth_compileSolidity
eth_getCompilers
eth_getProofEIP-1186
eth_getWork
db_*
shh_*

图例解释:❌ = 不支持。 🚧 = 开发中。 ✅ = 已支持。

备注

  • eth_sendRawTransaction supports legacy(EIP-155), type-1(EIP-2930) and type-2(EIP-1559) transactions. Type-3 transactions (EIP-4844) transactions are not supported yet.
  • 此处未列出的方法也不支持。
  • 没有所谓的 uncle(又称 ommer)区块。 eth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndex 方法总是返回 nulleth_getUncleCountByBlockHasheth_getUncleCountByBlockNumber 方法对有效的区块 ID 返回零,对无效的区块 ID 返回 null。 此外,与 uncle 相关的区块元数据如 sha3Uncles 是空的哈希数组 sha3。
  • 目前不支持非标准的 Geth 跟踪 API
  • 非标准 Parity 跟踪 API 正在开发中

extra burntGasFee field of transaction receipts

The implementation of 1559 in Conflux eSpace differs slightly from Ethereum. The base fee of the transaction is not entirely burned; instead, it is partially burned according to a certain ratio, with the remaining part still serving as the miner's revenue. An additional field burntGasFee is added to the transaction receipt (e.g. got from eth_getTransactionReceipt RPC) to record the amount of fees that is burned.

For more information, please refer to CIP-137.

pending 标签

eth_getTransactionCount 方法支持pending 标签。 其他方法将 pending 标签视为latest

  • eth_getTransactionCount ✅
  • eth_getBalance
  • eth_getCode
  • eth_getStorageAt
  • eth_call

注意:过滤相关的方法也不支持 pending 标签

数据可验证性

以下字段无法保证可验证性

Block

  • hash
  • stateRoot
  • receiptsRoot
  • transactionsRoot
  • totalDifficulty

Receipt

  • logsBloom

发布/订阅

从 v2.1.0 版本开始支持 newHeadslogs

ETH RPC 文档