本文档列出了所有 Ethereum JSON-RPC 方法及其在 Cosmos EVM 中的实现状态。有关官方的 Ethereum JSON-RPC 规范,请参阅 Ethereum Execution APIs 仓库。
命名空间配置:默认情况下,仅启用
eth、net 和 web3 命名空间。若要启用其他命名空间,例如 personal、txpool、debug 或 miner,你必须在节点的 app.toml 配置中进行设置。未实现的命名空间
以下命名空间在 Cosmos EVM 中未实现,但可能会出现在交互式浏览器中,以便针对其他网络进行测试:debug - 调试与追踪(部分实现)
debug - 调试与追踪(部分实现)
debug 命名空间为开发提供调试与追踪工具。Cosmos EVM 已实现部分追踪和性能分析方法。许多方法需要启用 Profiling 配置。admin - 节点管理(不适用)
admin - 节点管理(不适用)
admin 命名空间用于节点管理和对等节点管理。Cosmos 节点通过 Cosmos SDK CLI 和配置文件使用不同的管理机制。miner - 挖矿操作(不适用)
miner - 挖矿操作(不适用)
miner 命名空间控制工作量证明挖矿操作。Cosmos EVM 使用 CometBFT 拜占庭容错共识,而不是挖矿。engine - 合并后的 Engine API(不适用)
engine - 合并后的 Engine API(不适用)
engine 命名空间实现 Ethereum 在合并后的 Engine API,用于与共识层通信。Cosmos EVM 使用 CometBFT 共识,而不是信标链。clique - 权威证明(不适用)
clique - 权威证明(不适用)
clique 命名空间为私有网络实现权威证明共识。Cosmos EVM 使用 CometBFT 共识。les - 轻客户端协议(不支持)
les - 轻客户端协议(不支持)
les 命名空间实现 Light Ethereum Subprotocol。Cosmos 通过 IBC 采用不同的轻客户端架构。端点
| 方法 | 命名空间 | 状态 | 公开 | 说明 |
|---|---|---|---|---|
web3_clientVersion | Web3 | Y | Y | |
web3_sha3 | Web3 | Y | Y | |
net_version | Net | Y | Y | |
net_peerCount | Net | 桩实现 | Y | 返回 “0x0” |
net_listening | Net | 桩实现 | Y | 返回 true |
eth_protocolVersion | Eth | Y | Y | |
eth_syncing | Eth | 桩实现 | Y | 返回 false |
eth_gasPrice | Eth | 桩实现 | Y | 返回 “0x0” |
eth_accounts | Eth | Y | Y | |
eth_blockNumber | Eth | Y | Y | |
eth_getBalance | Eth | Y | Y | |
eth_getStorageAt | Eth | Y | Y | |
eth_getTransactionCount | Eth | Y | Y | |
eth_getBlockTransactionCountByNumber | Eth | 桩实现 | Y | 返回 “0x0” |
eth_getBlockTransactionCountByHash | Eth | 桩实现 | Y | 返回 “0x0” |
eth_getCode | Eth | 桩实现 | Y | 返回 “0x” |
eth_sign | Eth | Y | N | |
eth_sendTransaction | Eth | N | N | 未实现 |
eth_sendRawTransaction | Eth | Y | Y | |
eth_call | Eth | 桩实现 | Y | 返回 “0x” |
eth_createAccessList | Eth | Y | Y | EIP-2930 |
eth_estimateGas | Eth | Y | Y | 已优化 |
eth_getBlockByNumber | Eth | Y | Y | |
eth_getBlockByHash | Eth | Y | Y | |
eth_getTransactionByHash | Eth | 桩实现 | Y | 返回 null |
eth_getTransactionByBlockHashAndIndex | Eth | 桩实现 | Y | 返回 null |
eth_getTransactionReceipt | Eth | 桩实现 | Y | 返回 null |
eth_newFilter | Eth | Y | Y | |
eth_newBlockFilter | Eth | Y | Y | |
eth_newPendingTransactionFilter | Eth | Y | Y | |
eth_uninstallFilter | Eth | 桩实现 | Y | 返回 true |
eth_getFilterChanges | Eth | 桩实现 | Y | 返回空数组 |
eth_getFilterLogs | Eth | 桩实现 | Y | 返回空数组 |
eth_getLogs | Eth | 桩实现 | Y | 返回 [] |
eth_getTransactionByBlockNumberAndIndex | Eth | 桩实现 | Y | 返回 null |
eth_getWork | Eth | N | Y | 未实现 |
eth_submitWork | Eth | N | Y | 未实现 |
eth_submitHashrate | Eth | N | Y | 未实现 |
eth_getCompilers | Eth | N | N | 未实现 |
eth_compileLLL | Eth | N | N | 未实现 |
eth_compileSolidity | Eth | N | N | 未实现 |
eth_compileSerpent | Eth | N | N | 未实现 |
eth_signTransaction | Eth | N | N | 未实现 |
eth_mining | Eth | Y | Y | 已弃用 - 始终为 false |
eth_coinbase | Eth | Y | Y | 在 geth 中已弃用 |
eth_hashrate | Eth | Y | Y | 已弃用 - 始终为 0 |
eth_getUncleCountByBlockHash | Eth | 桩实现 | Y | 始终为 “0x0” |
eth_getUncleCountByBlockNumber | Eth | 桩实现 | Y | 始终为 “0x0” |
eth_getUncleByBlockHashAndIndex | Eth | 桩实现 | Y | 始终为 null |
eth_getUncleByBlockNumberAndIndex | Eth | 桩实现 | Y | 始终为 null |
eth_getProof | Eth | Y | Y | |
eth_feeHistory | Eth | Y | Y | EIP-1559 |
eth_maxPriorityFeePerGas | Eth | 桩实现 | Y | 返回 “0x0” |
eth_chainId | Eth | Y | Y | |
eth_getBlockReceipts | Eth | 桩实现 | Y | 返回空数组 |
eth_resend | Eth | N | Y | 需要 nonce 参数 |
eth_createAccessList | Eth | Y | Y | EIP-2930 |
eth_blobBaseFee | Eth | N | Y | EIP-4844 未实现 |
eth_fillTransaction | Eth | N | Y | 未实现 |
eth_signTypedData | Eth | N | N | 需要 domain 参数 |
eth_signTypedData_v3 | Eth | N | N | 未实现 |
| eth_signTypedData_v4 | Eth | N | N | 未实现 |
| eth_pendingTransactions | Eth | N | Y | 未实现 |
| eth_getPendingTransactions | Eth | Y | Y | 在 geth 中已弃用 |
| eth_getHeaderByHash | Eth | Y | Y | |
| eth_getHeaderByNumber | Eth | Y | Y | |
| eth_simulateV1 | Eth | N | Y | Geth 特有,未实现 |
| eth_getRawTransactionByHash | Eth | N | Y | 未实现 |
| eth_getRawTransactionByBlockNumberAndIndex | Eth | N | Y | 未实现 |
| eth_getRawTransactionByBlockHashAndIndex | Eth | N | Y | 未实现 |
| eth_subscribe | Websocket | Y | Y | 仅限 WebSocket |
| eth_unsubscribe | Websocket | Y | Y | 仅限 WebSocket |
| personal_importRawKey | Personal | N | N | 需要有效的十六进制密钥 |
| personal_listAccounts | Personal | Y | N | 需要 v0.4.x mempool |
| personal_lockAccount | Personal | Stub | N | 始终为 false |
| personal_newAccount | Personal | Y | N | 需要 v0.4.x mempool |
| personal_unlockAccount | Personal | Stub | N | 始终为 false |
| personal_sendTransaction | Personal | N | N | 未实现 |
| personal_sign | Personal | Y | N | 需要 v0.4.x mempool |
| personal_ecRecover | Personal | N | N | 需要 65 字节签名 |
| personal_initializeWallet | Personal | N | N | 未实现 |
| personal_unpair | Personal | N | N | 未实现 |
| personal_listWallets | Personal | Stub | N | 返回 null |
| personal_signTransaction | Personal | N | N | 未实现 |
| personal_signAndSendTransaction | Personal | N | N | 未实现 |
| personal_openWallet | Personal | N | N | 未实现 |
| personal_deriveAccount | Personal | N | N | 未实现 |
| db_putString | DB | N | N | 已弃用 |
| db_getString | DB | N | N | 已弃用 |
| db_putHex | DB | N | N | 已弃用 |
| db_getHex | DB | N | N | 已弃用 |
| shh_post | SSH | N | N | 已弃用 |
| shh_version | SSH | N | N | 已弃用 |
| shh_newIdentity | SSH | N | N | 已弃用 |
| shh_hasIdentity | SSH | N | N | 已弃用 |
| shh_newGroup | SSH | N | N | 已弃用 |
| shh_addToGroup | SSH | N | N | 已弃用 |
| shh_newFilter | SSH | N | N | 已弃用 |
| shh_uninstallFilter | SSH | N | N | 已弃用 |
| shh_getFilterChanges | SSH | N | N | 已弃用 |
| shh_getMessages | SSH | N | N | 已弃用 |
| admin_addPeer | Admin | N | N | 返回 undefined |
| admin_removePeer | Admin | N | N | 返回 undefined |
| admin_datadir | Admin | N | N | 返回 undefined |
| admin_nodeInfo | Admin | N | N | 返回 undefined |
| admin_peers | Admin | N | N | 返回 undefined |
| admin_startHTTP | Admin | N | N | 返回 undefined |
| admin_startWS | Admin | N | N | 返回 undefined |
| admin_stopHTTP | Admin | N | N | 返回 undefined |
| admin_stopWS | Admin | N | N | 返回 undefined |
| admin_addTrustedPeer | Admin | N | N | 返回 undefined |
| admin_removeTrustedPeer | Admin | N | N | 返回 undefined |
| admin_startRPC | Admin | N | N | 返回 undefined |
| admin_stopRPC | Admin | N | N | 返回 undefined |
| admin_exportChain | Admin | N | N | 返回 undefined |
| admin_importChain | Admin | N | N | 返回 undefined |
| admin_sleepBlocks | Admin | N | N | 返回 undefined |
| admin_clearPeerBanList | Admin | N | N | 返回 undefined |
| admin_listPeerBanList | Admin | N | N | 返回 undefined |
| clique_getSnapshot | Clique | N | N | 返回 undefined |
| clique_getSnapshotAtHash | Clique | N | N | 返回 undefined |
| clique_getSigners | Clique | N | N | 返回 undefined |
| clique_getSignersAtHash | Clique | N | N | 返回 undefined |
| clique_propose | Clique | N | N | 返回 undefined |
| clique_discard | Clique | N | N | 返回 undefined |
| clique_status | Clique | N | N | 返回 undefined |
| clique_getSigner | Clique | N | N | 返回 undefined |
| debug_backtraceAt | Debug | N | N | 返回 undefined |
| debug_blockProfile | Debug | Y | N | |
| debug_cpuProfile | Debug | Y | N | |
| debug_dumpBlock | Debug | N | N | 返回 undefined |
| debug_gcStats | Debug | Y | N | |
| debug_getBlockRlp | Debug | N | N | 需要 uint64 参数 |
| debug_goTrace | Debug | Y | N | |
| debug_freeOSMemory | Debug | Y | N | |
| debug_memStats | Debug | Y | N | |
| debug_mutexProfile | Debug | Y | N | |
| debug_seedHash | Debug | N | N | 未实现 |
| debug_setHead | Debug | N | N | 未实现 |
| debug_setBlockProfileRate | Debug | Y | N | |
| debug_setGCPercent | Debug | Y | N | |
| debug_setMutexProfileFraction | Debug | Y | N | |
| debug_stacks | Debug | Y | N | |
| debug_startCPUProfile | Debug | Y | N | |
| debug_startGoTrace | Debug | Y | N | |
| debug_stopCPUProfile | Debug | Y | N | |
| debug_stopGoTrace | Debug | Y | N | |
| debug_traceBlock | Debug | Y | N | |
| debug_traceBlockByNumber | Debug | Y | N | |
| debug_traceBlockByHash | Debug | Y | N | |
| debug_traceBlockFromFile | Debug | N | N | 返回 undefined |
| debug_standardTraceBlockToFile | Debug | N | N | 返回 undefined |
| debug_standardTraceBadBlockToFile | Debug | N | N | 返回 undefined |
| debug_traceTransaction | Debug | Y | N | |
| debug_traceCall | Debug | Y | N | |
| debug_traceChain | Debug | N | N | 返回 undefined |
| debug_traceBadBlock | Debug | N | N | 返回 undefined |
| debug_verbosity | Debug | N | N | 未实现 |
| debug_vmodule | Debug | N | N | 未实现 |
| debug_writeBlockProfile | Debug | Y | N | |
| debug_writeMemProfile | Debug | Y | N | |
| debug_writeMutexProfile | Debug | Y | N | |
| debug_getRawBlock | Debug | N | N | 未实现 |
| debug_getRawHeader | Debug | N | N | 未实现 |
| debug_getRawReceipts | Debug | N | N | 未实现 |
| debug_getRawTransaction | Debug | N | N | 未实现 |
| debug_printBlock | Debug | Y | N | |
| debug_getHeaderRlp | Debug | N | N | 需要 uint64 参数 |
| debug_intermediateRoots | Debug | Y | N | 返回空哈希 |
| debug_getBadBlocks | Debug | N | N | 未实现 |
| debug_storageRangeAt | Debug | N | N | 未实现 |
| debug_getModifiedAccountsByNumber | Debug | N | N | 未实现 |
| debug_getModifiedAccountsByHash | Debug | N | N | 未实现 |
| les_serverInfo | Les | N | N | 返回 undefined |
| les_clientInfo | Les | N | N | 返回 undefined |
| les_priorityClientInfo | Les | N | N | 返回 undefined |
| les_addBalance | Les | N | N | 返回 undefined |
| les_setClientParams | Les | N | N | 返回 undefined |
| les_setDefaultParams | Les | N | N | 返回 undefined |
| les_latestCheckpoint | Les | N | N | 返回 undefined |
| les_getCheckpoint | Les | N | N | 返回 undefined |
| les_getCheckpointContractAddress | Les | N | N | 返回 undefined |
| txpool_content | TxPool | Y | Y | 参见实验性内存池 |
| txpool_contentFrom | TxPool | Y | Y | 参见实验性内存池 |
| txpool_inspect | TxPool | Y | Y | 参见实验性内存池 |
| txpool_status | TxPool | Y | Y | 参见实验性内存池 |
| trace_callMany | Trace | N | N | 未实现 |
| eth_signTypedData | Eth | W | N | EIP-712 部分支持 |
| eth_fillTransaction | Eth | Y | Y | |
| eth_getTransactionLogs | Eth | Y | Y | Cosmos 特有|
| miner_start | Miner | N | N | 返回 undefined |
| miner_stop | Miner | N | N | 返回 undefined |
| miner_setEtherbase | Miner | N | N | 返回 undefined |
| miner_setGasPrice | Miner | N | N | 返回 undefined |
| miner_setGasLimit | Miner | N | N | 返回 undefined |
| miner_setExtra | Miner | N | N | 返回 undefined |
| miner_setRecommitInterval | Miner | N | N | 返回 undefined |
| miner_getHashrate | Miner | N | N | 返回 undefined |
| engine_newPayloadV1 | Engine | N | N | 返回 undefined |
| engine_newPayloadV2 | Engine | N | N | 返回 undefined |
| engine_newPayloadV3 | Engine | N | N | 返回 undefined |
| engine_forkchoiceUpdatedV1 | Engine | N | N | 返回 undefined |
| engine_forkchoiceUpdatedV2 | Engine | N | N | 返回 undefined |
| engine_forkchoiceUpdatedV3 | Engine | N | N | 返回 undefined |
| engine_getPayloadV1 | Engine | N | N | 返回 undefined |
| engine_getPayloadV2 | Engine | N | N | 返回 undefined |
| engine_getPayloadV3 | Engine | N | N | 返回 undefined |
| engine_exchangeCapabilities | Engine | N | N | 返回 undefined |
| engine_exchangeTransitionConfigurationV1 | Engine | N | N | 返回 undefined |
| engine_getPayloadBodiesByHashV1 | Engine | N | N | 返回 undefined |
| engine_getPayloadBodiesByRangeV1 | Engine | N | N | 返回 undefined |
| engine_getBlobsV1 | Engine | N | N | 返回 undefined |
| trace_call | Trace | N | N | 未实现 |
| trace_rawTransaction | Trace | N | N | 未实现 |
| trace_replayBlockTransactions | Trace | N | N | 未实现 |
| trace_replayTransaction | Trace | N | N | 未实现 |
| trace_block | Trace | N | N | 未实现 |
| trace_filter | Trace | N | N | 未实现 |
| trace_get | Trace | N | N | 未实现 |
| trace_transaction | Trace | N | N | 未实现 |
区块号可以输入为十六进制字符串、
"earliest"、"latest" 或 "pending"。EIP-1559 支持:Cosmos EVM 支持 EIP-1559 交易类型以及
eth_maxPriorityFeePerGas,但 eth_feeHistory 尚未实现。共识差异:由于使用的是 CometBFT BFT 共识,而不是工作量证明/权益证明:- 与 uncle 相关的方法始终返回 0 或 null
- 不会发生区块重组
- Engine API(
engine_*)不适用,CometBFT负责处理共识
eth_createAccessList(EIP-2930)- 访问列表交易eth_feeHistory- EIP-1559 的手续费历史eth_getFilterChanges/eth_getFilterLogs- 过滤器管理问题eth_fillTransaction- 交易填充工具eth_resend- 交易重发工具personal_sendTransaction/personal_ecRecover- Personal 命名空间方法personal_lockAccount- 始终返回 false(不支持)debug_getRaw*方法 - 原始数据访问方法debug_printBlock- 区块打印工具trace_*方法 - 高级追踪功能engine_*方法 - 合并后的 Engine API(改用CometBFT)admin_*方法 - 节点管理les_*方法 - 轻量以太坊子协议clique_*方法 - 权威证明共识
eth_getProof- 要求区块高度 > 2eth_signTypedData(EIP-712)- 部分实现eth_subscribe- 支持 newHeads、logs 和 newPendingTransactions,但不支持 syncingpersonal_unlockAccount- 始终返回 falsedebug_traceTransaction- 在区块高度方面存在问题
示例
下面列出了各命名空间中的 RPC 方法、参数以及响应示例。Web3 方法
web3_clientVersion
获取 web3 客户端版本。
参数 (0)
结果
客户端示例
Shell HTTPweb3_sha3
返回给定数据的 Keccak-256(不是标准化的 SHA3-256)。
参数 (1)
1: inputhexutil.Bytes
- 必填:[Y] 是
结果
客户端示例
Shell HTTPNet 方法
net_version
返回当前网络 ID。
net_peerCount
返回当前连接到客户端的对等节点数量。
net_listening
返回客户端是否正在主动监听网络连接。
Eth 方法
eth_protocolVersion
返回当前的 Ethereum 协议版本。
eth_syncing
同步状态对象可能需要根据 cometbft 同步协议的细节而有所不同。不过,synced 结果只是一个布尔值,可以很容易地从 cometbft 的内部同步状态中推导出来。
eth_gasPrice
返回默认 EVM 面额参数中的当前 gas 价格。
eth_accounts
返回所有 eth 账户组成的数组。
eth_blockNumber
返回当前区块高度。
eth_getBalance
返回给定账户地址在指定区块编号下的账户余额。
参数
- 账户地址
- 区块编号或区块哈希(EIP-1898)
eth_getStorageAt
返回给定账户地址的存储地址。
参数
- 账户地址
- 存储中位置对应的整数
- 区块编号或区块哈希(EIP-1898)
eth_getTransactionCount
返回给定账户地址在指定区块编号下的交易总数。
参数
- 账户地址
- 区块编号或区块哈希(EIP-1898)
eth_getBlockTransactionCountByNumber
返回给定区块编号的交易总数。
参数
- 区块编号
eth_getBlockTransactionCountByHash
返回给定区块哈希的交易总数。
参数
- 区块哈希
eth_getCode
返回给定账户地址在指定区块编号下的代码。
参数
- 账户地址
- 区块编号或区块哈希(EIP-1898)
eth_sign
sign 方法会按如下方式计算一个以太坊特定签名:sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))。
为消息添加前缀后,计算得到的签名可以被识别为以太坊特定签名。这可以防止恶意 DApp 对任意数据(例如交易)进行签名,并利用该签名冒充受害者。
参数
- 账户地址
- 待签名的消息
eth_signTypedData
根据 EIP-712 对类型化结构化数据进行签名。与 eth_sign 相比,此方法提供了更安全的结构化数据签名方式。
参数
- 账户地址(20 字节)
- 包含以下内容的类型化数据对象:
domain:EIP-712 域分隔符types:类型定义primaryType:主类型名称message:要签名的消息
eth_sendTransaction
将交易从给定账户发送到另一个给定账户。
参数
-
包含以下内容的对象:
from:DATA,20 字节 - 发送交易的地址。to:DATA,20 字节 - 交易指向的地址(创建新合约时可选)。gas:QUANTITY - (可选,默认:90000)为交易执行提供的 gas 整数值。未使用的 gas 会被退回。gasPrice:QUANTITY - (可选,默认:待定)每单位已支付 gas 使用的 gasPrice 整数值value:QUANTITY - 随此交易发送的值data:DATA- 合约的已编译代码,或调用的方法签名哈希及编码后的参数。详情参见 Ethereum Contract ABI。nonce:QUANTITY - (可选)nonce 的整数值。这允许你覆盖自己使用相同 nonce 的待处理交易。
eth_sendRawTransaction
为已签名交易创建新的消息调用交易或合约创建交易。你可以使用 personal_sign 方法获取已签名交易数据。
参数
- 已签名的交易数据
eth_call
立即执行一次新的消息调用,而不会在区块链上创建交易。
参数
-
包含以下内容的对象:
from:DATA,20 字节 - (可选)发送交易的地址。to:DATA,20 字节 - 交易指向的地址。gas:QUANTITY - 为交易执行提供的 gas。eth_call消耗零 gas,但某些执行可能仍需要此参数。gasPrice:QUANTITY - 每单位已支付 gas 使用的 gasPricevalue:QUANTITY - 随此交易发送的值data:DATA- (可选)方法签名的哈希及编码后的参数。详情参见 Solidity 文档中的 Ethereum Contract ABI - 区块号或区块哈希(EIP-1898)
eth_createAccessList
为交易创建访问列表。访问列表会指定交易将访问哪些地址和存储键,从而可能降低复杂交易的 gas 成本。
实现: rpc/backend/tx_info.go:396
参数
-
包含交易数据的对象:
from:DATA,20 字节 - (可选)发送交易的地址to:DATA,20 字节 - 交易指向的地址gas:QUANTITY- (可选)执行所提供的 gasgasPrice:QUANTITY- (可选)每单位 gas 的价格value:QUANTITY- (可选)随交易发送的值data:DATA- (可选)交易数据负载
- 区块号或区块哈希(EIP-1898)
返回值
- 包含以下内容的对象:
accessList:访问列表条目数组address:DATA,20 字节 - 账户地址storageKeys:DATA数组 - 被访问的存储键
gasUsed:QUANTITY- 使用访问列表执行时消耗的 gas
客户端示例
Shell HTTP结果
使用示例
eth_estimateGas
返回发送该交易所需 gas 的估算值。
参数
-
包含以下内容的对象:
from:DATA,20 字节 - 发送交易的地址。to:DATA,20 字节 - 交易指向的地址(创建新合约时可选)。value:QUANTITY- 随此交易发送的值
eth_getBlockByNumber
按区块号返回区块信息。
参数
- 区块号
- 如果为 true,则返回完整的交易对象;如果为 false,则只返回交易哈希。
eth_getBlockByHash
根据上一个命令中找到的哈希值和一个布尔值返回区块信息。
参数
- 区块的哈希。
- 如果为 true,则返回完整的交易对象;如果为 false,则只返回交易哈希。
eth_getHeaderByHash
根据区块哈希返回区块头信息。区块头包含区块的元数据,但不包含完整的交易列表。
实现: rpc/backend/headers.go:21
参数
DATA,32 字节 - 区块的哈希
返回
- 对象 - 区块头对象,包含:
parentHash:DATA,32 字节 - 父区块的哈希sha3Uncles:DATA,32 字节 - 区块中叔块数据的 SHA3miner:DATA,20 字节 - 区块矿工地址stateRoot:DATA,32 字节 - 状态 trie 的根transactionsRoot:DATA,32 字节 - 交易 trie 的根receiptsRoot:DATA,32 字节 - 收据 trie 的根logsBloom:DATA,256 字节 - 区块日志的布隆过滤器difficulty:QUANTITY- 该区块的难度number:QUANTITY- 区块号gasLimit:QUANTITY- 该区块允许的最大 gasgasUsed:QUANTITY- 所有交易消耗的 gas 总量timestamp:QUANTITY- 区块创建时的 Unix 时间戳extraData:DATA- 该区块的额外数据字段mixHash:DATA,32 字节 - Mix 哈希nonce:DATA,8 字节 - 工作量证明哈希baseFeePerGas:QUANTITY- 每单位 gas 的基础费用(EIP-1559)hash:DATA,32 字节 - 区块哈希
客户端示例
Shell HTTP结果
eth_getHeaderByNumber
根据区块号返回区块头信息。与 eth_getHeaderByHash 类似,但接收的是区块号而不是哈希。
实现: rpc/backend/headers.go:13
参数
- 作为
QUANTITY(十六进制字符串)的区块号,或区块标签:"latest"- 最新已挖出的区块"earliest"- 创世区块"pending"- 待处理状态/交易
返回
- 对象 - 区块头对象(与
eth_getHeaderByHash结构相同)
客户端示例
Shell HTTP结果
eth_getTransactionByHash
给定以太坊交易哈希,返回交易详情。
参数
- 交易的哈希值
eth_getTransactionByBlockHashAndIndex
给定区块哈希和交易索引,返回交易详情。
参数
- 区块的哈希值。
- 交易索引位置。
eth_getTransactionReceipt
根据交易哈希返回交易回执。
注意:CometBFT 的 Tx Code 与 Ethereum 的回执状态是相反的:
| CometBFT | Ethereum | |
|---|---|---|
| 成功 | 0 | 1 |
| 失败 | 1 | 0 |
参数
- 交易的哈希值
eth_newFilter
使用某种 topics 创建新的过滤器。
参数
- 交易的哈希值
eth_newBlockFilter
在节点中创建一个过滤器,以便在新区块到达时接收通知。
eth_newPendingTransactionFilter
在节点中创建一个过滤器,以便在新的待处理交易到达时接收通知。
eth_uninstallFilter
移除给定过滤器 ID 对应的过滤器。如果成功卸载过滤器则返回 true,否则返回 false。
参数
- 过滤器 ID
eth_getFilterChanges
用于过滤器的轮询方法,返回自上次轮询以来产生的日志数组。
参数
- 过滤器 id
eth_getFilterLogs
返回与给定 id 的过滤器匹配的所有日志组成的数组。
参数
QUANTITY- 过滤器 id
eth_getLogs
返回与给定过滤器对象匹配的所有日志组成的数组。
参数
-
包含以下内容的对象:
fromBlock:QUANTITY|TAG- (可选,默认:"latest")整数区块号,或"latest"表示最后一个已挖出的区块,或"pending"、"earliest"表示尚未挖出的交易。toBlock:QUANTITY|TAG- (可选,默认:"latest")整数区块号,或"latest"表示最后一个已挖出的区块,或"pending"、"earliest"表示尚未挖出的交易。address:DATA|Array,20 字节 - (可选)合约地址,或日志应来源的一组地址。topics:DATA数组 - (可选)由 32 字节DATA主题组成的数组。主题顺序相关。每个主题也可以是带有“or”选项的DATA数组。blockhash: (可选,未来)随着 EIP-234 的加入,blockHash将成为一个新的过滤器选项,用于将返回的日志限制为哈希为blockHash的单个区块。使用blockHash等同于fromBlock=toBlock= 哈希为blockHash的区块号。如果过滤条件中存在blockHash,则不允许再使用fromBlock或toBlock。
eth_coinbase
返回将接收挖矿奖励的账户。
eth_mining
返回客户端是否正在积极挖掘新区块。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识而不是挖矿,因此始终返回
false。eth_hashrate
返回节点挖矿时每秒执行的哈希数量。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识而不是挖矿,因此始终返回
0x0。eth_chainId
返回用于签名重放保护交易的链 ID。
eth_getUncleCountByBlockHash
返回与给定区块哈希匹配的区块中 uncle 的数量。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识且不存在 uncle,因此始终返回
0x0。参数
- 区块哈希
eth_getUncleCountByBlockNumber
返回与给定区块号匹配的区块中 uncle 的数量。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识且不存在 uncle,因此始终返回
0x0。参数
- 区块号
eth_getUncleByBlockHashAndIndex
返回按区块哈希和 uncle 索引位置查询到的 uncle 信息。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识且不存在 uncle,因此始终返回
null。参数
- 区块哈希
- Uncle 索引位置
eth_getUncleByBlockNumberAndIndex
返回按区块号和 uncle 索引位置查询到的 uncle 信息。
由于 Cosmos EVM 使用的是 ‘CometBFT’ 共识且不存在 uncle,因此始终返回
null。参数
- 区块号
- Uncle 索引位置
eth_getTransactionByBlockNumberAndIndex
返回按区块号和交易索引位置查询到的交易信息。
参数
- 区块号
- 交易索引位置
eth_maxPriorityFeePerGas
返回当前每单位 gas 的 maxPriorityFeePerGas,单位为 wei。
eth_getBlockReceipts
返回给定区块中所有交易的收据。
参数
- 区块号或区块哈希
eth_getTransactionLogs
返回特定交易的日志。
参数
- 交易哈希
eth_fillTransaction
为给定的未签名交易填充默认值(nonce、gas、gasPrice 或 1559 字段),并将其返回给调用方以便进一步处理(签名 + 广播)。
参数
- 带有可选字段的交易对象
eth_resend
使用更新后的 gas 参数重新发送交易。将给定交易从池中移除,并使用新的 gas price 和 gas limit 重新插入。
参数
- 原始交易对象(必须包含
nonce) - 新的 gas price(十六进制)
- 新的 gas limit(十六进制)
eth_getProof
返回指定账户的账户值和存储值,包括其 Merkle 证明。
参数
- 账户或合约地址
- 存储位置数组(32 字节存储槽)
- 区块号(必须是具体数字,不能是
"latest")
WebSocket 方法
阅读更多关于如何使用 websockets 的内容。eth_subscribe
使用 JSON-RPC 通知进行订阅。这使客户端可以等待事件,而不是轮询事件。其工作方式是订阅特定事件。节点将返回一个订阅 id。对于每个匹配该订阅的事件,都会连同订阅 id 一起发送包含相关数据的通知。
参数
- 订阅名称
- 可选参数
eth_unsubscribe
使用订阅 id 取消事件订阅。
参数
- 订阅 ID
Personal 方法
personal_importRawKey
私有:需要身份验证。
参数 (2)
1: privkeystring
- 必填:[Y] 是
- 格式:64 个十六进制字符(32 字节),不带
"0x"前缀
string
- 必填:[Y] 是
personal_listAccounts
私有:需要身份验证。
personal_lockAccount
私有:需要身份验证。
参数
- 账户地址
personal_newAccount
私有:需要身份验证。
参数
- 口令
personal_unlockAccount
私有:需要身份验证。
eth_sign 和 eth_sendTransaction 一起使用。
参数
- 账户地址
- 口令
- 时长
personal_sendTransaction
私有:需要身份验证。
eth_sendTransaction 相同,并包含 from 地址。如果该密码短语可用于解密属于 tx.from 的私钥,则会对交易进行校验、签名并发送到网络。
参数
-
对象,包含:
from:DATA,20 字节 - 发送该交易的地址。to:DATA,20 字节 - (创建新合约时可选)交易发送到的目标地址。value:QUANTITY - 随该交易发送的数值 - 密码短语
personal_sign
私有:需要身份验证。
sign(keccack256("\x19Ethereum Signed Message:\n" + len(message) + message))),
参数
- 消息
- 账户地址
- 密码
personal_ecRecover
私有:需要身份验证。
ecRecover 返回用于在 personal_sign 中计算签名的私钥所对应的地址。
参数
- 消息(十六进制编码)
- 从
personal_sign返回的签名(65 字节)
personal_initializeWallet
私有:需要身份验证。
参数(1)
参数必须按位置提供。 1:urlstring
- 必填:[Y] 是
客户端示例
Shell HTTPpersonal_unpair
私有:需要身份验证。
参数(2)
- URL
- 配对密码
客户端示例
Shell HTTPpersonal_listWallets
私有:需要身份验证。
当前返回
null,因为尚不支持钱包级管理。调试方法
debug_traceTransaction
traceTransaction 调试方法会尝试以该交易在网络上执行时完全相同的方式运行该交易。它会先重放在此交易之前可能已执行的所有交易,然后再尝试执行与给定哈希对应的交易。
参数
- Trace Config
debug_traceBlockByNumber
traceBlockByNumber 端点接收一个区块号,并重放数据库中已存在的该区块。
存根实现:该方法已实现,但当前对所有请求都返回空数组。在 Cosmos EVM 中,追踪功能尚未完全可用。
参数
- 区块号(十六进制字符串)
- Trace Config(可选)
debug_traceBlockByHash
与 debug_traceBlockByNumber 类似,该方法接收一个区块哈希,并重放数据库中已存在的该区块。
存根实现:该方法已实现,但当前对所有请求都返回空数组。在 Cosmos EVM 中,追踪功能尚未完全可用。
参数
- 区块哈希(32 字节哈希)
- Trace Config(可选)
debug_traceCall
在给定区块的上下文中追踪一次 eth_call 的执行。这使你可以在不将交易广播到网络的情况下模拟交易并追踪其执行过程。
实现: rpc/namespaces/ethereum/debug/api.go:158
参数
-
包含交易调用数据的对象:
from:DATA,20 字节 - (可选)发起该调用的地址to:DATA,20 字节 - 该调用的目标地址gas:QUANTITY- (可选)为调用执行提供的 GasgasPrice:QUANTITY- (可选)每单位 Gas 的 Gas 价格value:QUANTITY- (可选)随调用发送的数值data:DATA- (可选)调用数据负载
- 区块号或区块哈希(EIP-1898)
-
Tracer 配置(可选)- 对象,包含:
tracer:string- Tracer 类型(“callTracer”、“prestateTracer”、“4byteTracer” 或自定义 JavaScript tracer)timeout:string- 追踪执行的超时时间(例如 “5s”)tracerConfig:对象 - Tracer 专用配置选项
返回值
- 对象 - 追踪结果结构取决于所使用的 tracer:
- callTracer:返回包含 Gas 使用情况和子调用的调用帧树
- prestateTracer:返回前置状态(账户余额、nonce、代码、存储)
- 4byteTracer:返回 4 字节函数选择器到调用次数的映射
- opcodeTracer:返回已执行的操作码列表
客户端示例
Shell HTTP结果
用法示例
debug_freeOSMemory
强制 Go 运行时执行一次垃圾回收,并将未使用的内存归还给操作系统。
私有:需要认证。
debug_setGCPercent
设置垃圾回收目标百分比。负值将禁用垃圾回收。
私有:需要认证。
参数
- GC 百分比(整数)
debug_memStats
返回详细的运行时内存统计信息。
私有:需要认证。
debug_setBlockProfileRate
设置 goroutine 阻塞分析数据的采集速率。非零值会启用阻塞分析。
私有:需要认证。
参数
- 分析速率(整数)
debug_writeBlockProfile
将 goroutine 阻塞分析写入指定文件。
私有:需要认证。
参数
- 文件路径(字符串)
debug_writeMemProfile
将分配分析写入指定文件。
私有:需要认证。
参数
- 文件路径(字符串)
debug_writeMutexProfile
将互斥锁竞争分析写入指定文件。
私有:需要认证。
参数
- 文件路径(字符串)
debug_blockProfile
为给定时长开启阻塞分析,并将分析数据写入磁盘。
私有:需要认证。
参数
- 文件路径(字符串) - 分析结果的输出文件
- 持续时间(秒,数字)
debug_cpuProfile
为给定时长开启 CPU 分析,并将分析数据写入磁盘。
私有:需要认证。
参数
- 文件路径(字符串) - 分析结果的输出文件
- 持续时间(秒,数字)
debug_gcStats
返回垃圾回收统计信息。
私有:需要认证。
Cosmos 特有:此方法是 Cosmos EVM 独有的。
debug_goTrace
为给定时长开启 Go 运行时跟踪,并将跟踪数据写入磁盘。
私有:需要认证。
参数
- 文件路径(字符串) - 跟踪结果的输出文件
- 持续时间(秒,数字)
debug_stacks
返回所有 goroutine 栈的打印表示。
私有:需要认证。
debug_startCPUProfile
开始无限期的 CPU 分析,并写入给定文件。
私有:需要认证。
参数
- 文件路径(字符串) - 分析结果的输出文件
debug_stopCPUProfile
停止正在进行的 CPU 性能分析。
私有:需要身份验证。
debug_mutexProfile
为给定时长开启互斥锁性能分析,并将分析数据写入磁盘。
私有:需要身份验证。
参数
- 文件路径(string)- 分析结果的输出文件
- 持续时间(秒,number)
debug_setMutexProfileFraction
设置互斥锁性能分析的采样率。
私有:需要身份验证。
Cosmos 特有:此方法是 Cosmos EVM 独有的。
参数
- 采样率(number)-
0表示禁用,1表示完整分析
debug_getHeaderRlp
返回区块头的 RLP 编码。
私有:需要身份验证。
参数
- 区块号(
uint64数字,不是十六进制字符串)
debug_getBlockRlp
返回区块的 RLP 编码。
私有:需要身份验证。
参数
- 区块号(
uint64数字,不是十六进制字符串)
debug_printBlock
返回区块的格式化字符串。
私有:需要身份验证。
参数
- 区块号(
uint64数字,不是十六进制字符串)
debug_intermediateRoots
返回某笔交易的中间状态根。
私有:需要身份验证。
参数
- 交易哈希(hash)
- 跟踪配置(object,可选)
TxPool 方法
txpool_content
返回当前所有待打包进后续区块的交易的精确详细信息列表,以及那些仅被安排在未来执行的交易。
参数(0)
客户端示例
Shell HTTP结果
txpool_contentFrom
返回来自指定地址、当前待打包进后续区块的交易,以及那些仅被安排在未来执行的交易。
参数(1)
address- 用于筛选交易的地址(20 字节)
客户端示例
Shell HTTP结果
txpool_inspect
以文本格式返回列表,汇总当前所有待打包进后续区块的交易,以及那些仅被安排在未来执行的交易。此方法专门为开发者设计,用于快速查看交易池中的交易并发现潜在问题。
参数(0)
客户端示例
Shell HTTP结果
txpool_status
返回当前待打包进后续区块的交易数量,以及那些仅被安排在未来执行的交易数量。
参数(0)
客户端示例
Shell HTTP结果
eth_createAccessList
此方法已完整实现,并支持 EIP-2930 访问列表交易。
参数
-
交易对象 - 交易调用对象
from:DATA,20 字节 - (可选)发送该交易的地址to:DATA,20 字节 - 交易发送到的目标地址gas:QUANTITY- (可选)为交易执行提供的 gas 整数值gasPrice:QUANTITY- (可选)每单位已支付 gas 使用的 gasPrice 整数值maxFeePerGas:QUANTITY- (可选)发送方愿意支付的每单位 gas 的最高费用maxPriorityFeePerGas:QUANTITY- (可选)发送方愿意支付的每单位 gas 的最高优先费value:QUANTITY- (可选)随该交易发送的值的整数值data:DATA- (可选)方法签名的哈希及编码后的参数accessList:ARRAY- (可选)交易计划访问的地址和存储键列表
-
区块参数 -
QUANTITY|TAG- 整数区块号,或字符串"latest"、"earliest"或"pending"
客户端示例
Shell HTTP结果
返回值
accessList:ARRAY- 交易使用的地址和存储键列表address:DATA,20 Bytes - 交易访问的地址storageKeys:ARRAY- 在该地址访问的存储键数组
gasUsed:QUANTITY- 交易在使用访问列表时预计消耗的 gas
This documentation lists all Ethereum JSON-RPC methods and their implementation status in Cosmos EVM. For the official Ethereum JSON-RPC specification, see the Ethereum Execution APIs repository.
Namespace Configuration: By default, only the
eth, net, and web3 namespaces are enabled. To enable additional namespaces like personal, txpool, debug, or miner, you must configure them in your node’s app.toml config.Non-Implemented Namespaces
The following namespaces are not implemented in Cosmos EVM but may be present in the interactive explorer for testing against other networks:debug - Debugging and Tracing (Partially Implemented)
debug - Debugging and Tracing (Partially Implemented)
The
debug namespace provides debugging and tracing tools for development. Some tracing and profiling methods are implemented in Cosmos EVM. Many methods require the Profiling config to be enabled.admin - Node Administration (Not Applicable)
admin - Node Administration (Not Applicable)
The
admin namespace handles node administration and peer management. Cosmos nodes use different administration mechanisms through the Cosmos SDK CLI and configuration files.miner - Mining Operations (Not Applicable)
miner - Mining Operations (Not Applicable)
The
miner namespace controls Proof of Work mining operations. Cosmos EVM uses ‘CometBFT’ Byzantine Fault Tolerant consensus instead of mining.engine - Post-Merge Engine API (Not Applicable)
engine - Post-Merge Engine API (Not Applicable)
The
engine namespace implements Ethereum’s post-merge Engine API for communication with the consensus layer. Cosmos EVM uses ‘CometBFT’ consensus instead of the beacon chain.clique - Proof of Authority (Not Applicable)
clique - Proof of Authority (Not Applicable)
les - Light Client Protocol (Not Supported)
les - Light Client Protocol (Not Supported)
The
les namespace implements the Light Ethereum Subprotocol. Cosmos has a different light client architecture through IBC.Endpoints
| Method | Namespace | Status | Public | Notes |
|---|---|---|---|---|
web3_clientVersion | Web3 | Y | Y | |
web3_sha3 | Web3 | Y | Y | |
net_version | Net | Y | Y | |
net_peerCount | Net | Stub | Y | Returns “0x0” |
net_listening | Net | Stub | Y | Returns true |
eth_protocolVersion | Eth | Y | Y | |
eth_syncing | Eth | Stub | Y | Returns false |
eth_gasPrice | Eth | Stub | Y | Returns “0x0” |
eth_accounts | Eth | Y | Y | |
eth_blockNumber | Eth | Y | Y | |
eth_getBalance | Eth | Y | Y | |
eth_getStorageAt | Eth | Y | Y | |
eth_getTransactionCount | Eth | Y | Y | |
eth_getBlockTransactionCountByNumber | Eth | Stub | Y | Returns “0x0” |
eth_getBlockTransactionCountByHash | Eth | Stub | Y | Returns “0x0” |
eth_getCode | Eth | Stub | Y | Returns “0x” |
eth_sign | Eth | Y | N | |
eth_sendTransaction | Eth | N | N | Not implemented |
eth_sendRawTransaction | Eth | Y | Y | |
eth_call | Eth | Stub | Y | Returns “0x” |
eth_createAccessList | Eth | Y | Y | EIP-2930 |
eth_estimateGas | Eth | Y | Y | Optimized |
eth_getBlockByNumber | Eth | Y | Y | |
eth_getBlockByHash | Eth | Y | Y | |
eth_getTransactionByHash | Eth | Stub | Y | Returns null |
eth_getTransactionByBlockHashAndIndex | Eth | Stub | Y | Returns null |
eth_getTransactionReceipt | Eth | Stub | Y | Returns null |
eth_newFilter | Eth | Y | Y | |
eth_newBlockFilter | Eth | Y | Y | |
eth_newPendingTransactionFilter | Eth | Y | Y | |
eth_uninstallFilter | Eth | Stub | Y | Returns true |
eth_getFilterChanges | Eth | Stub | Y | Returns empty array |
eth_getFilterLogs | Eth | Stub | Y | Returns empty array |
eth_getLogs | Eth | Stub | Y | Returns [] |
eth_getTransactionByBlockNumberAndIndex | Eth | Stub | Y | Returns null |
eth_getWork | Eth | N | Y | Not implemented |
eth_submitWork | Eth | N | Y | Not implemented |
eth_submitHashrate | Eth | N | Y | Not implemented |
eth_getCompilers | Eth | N | N | Not implemented |
eth_compileLLL | Eth | N | N | Not implemented |
eth_compileSolidity | Eth | N | N | Not implemented |
eth_compileSerpent | Eth | N | N | Not implemented |
eth_signTransaction | Eth | N | N | Not implemented |
eth_mining | Eth | Y | Y | Deprecated - always false |
eth_coinbase | Eth | Y | Y | Deprecated in geth |
eth_hashrate | Eth | Y | Y | Deprecated - always 0 |
eth_getUncleCountByBlockHash | Eth | Stub | Y | Always “0x0” |
eth_getUncleCountByBlockNumber | Eth | Stub | Y | Always “0x0” |
eth_getUncleByBlockHashAndIndex | Eth | Stub | Y | Always null |
eth_getUncleByBlockNumberAndIndex | Eth | Stub | Y | Always null |
eth_getProof | Eth | Y | Y | |
eth_feeHistory | Eth | Y | Y | EIP-1559 |
eth_maxPriorityFeePerGas | Eth | Stub | Y | Returns “0x0” |
eth_chainId | Eth | Y | Y | |
eth_getBlockReceipts | Eth | Stub | Y | Returns empty array |
eth_resend | Eth | N | Y | Requires nonce param |
eth_createAccessList | Eth | Y | Y | EIP-2930 |
eth_blobBaseFee | Eth | N | Y | EIP-4844 not implemented |
eth_fillTransaction | Eth | N | Y | Not implemented |
eth_signTypedData | Eth | N | N | Requires domain param |
eth_signTypedData_v3 | Eth | N | N | Not implemented |
eth_signTypedData_v4 | Eth | N | N | Not implemented |
eth_pendingTransactions | Eth | N | Y | Not implemented |
eth_getPendingTransactions | Eth | Y | Y | Deprecated in geth |
eth_getHeaderByHash | Eth | Y | Y | |
eth_getHeaderByNumber | Eth | Y | Y | |
eth_simulateV1 | Eth | N | Y | Geth-specific, not implemented |
eth_getRawTransactionByHash | Eth | N | Y | Not implemented |
eth_getRawTransactionByBlockNumberAndIndex | Eth | N | Y | Not implemented |
eth_getRawTransactionByBlockHashAndIndex | Eth | N | Y | Not implemented |
eth_subscribe | Websocket | Y | Y | WebSocket only |
eth_unsubscribe | Websocket | Y | Y | WebSocket only |
personal_importRawKey | Personal | N | N | Requires valid hex key |
personal_listAccounts | Personal | Y | N | Requires v0.4.x mempool |
personal_lockAccount | Personal | Stub | N | Always false |
personal_newAccount | Personal | Y | N | Requires v0.4.x mempool |
personal_unlockAccount | Personal | Stub | N | Always false |
personal_sendTransaction | Personal | N | N | Not implemented |
personal_sign | Personal | Y | N | Requires v0.4.x mempool |
personal_ecRecover | Personal | N | N | Requires 65-byte sig |
personal_initializeWallet | Personal | N | N | Not implemented |
personal_unpair | Personal | N | N | Not implemented |
personal_listWallets | Personal | Stub | N | Returns null |
personal_signTransaction | Personal | N | N | Not implemented |
personal_signAndSendTransaction | Personal | N | N | Not implemented |
personal_openWallet | Personal | N | N | Not implemented |
personal_deriveAccount | Personal | N | N | Not implemented |
db_putString | DB | N | N | Deprecated |
db_getString | DB | N | N | Deprecated |
db_putHex | DB | N | N | Deprecated |
db_getHex | DB | N | N | Deprecated |
shh_post | SSH | N | N | Deprecated |
shh_version | SSH | N | N | Deprecated |
shh_newIdentity | SSH | N | N | Deprecated |
shh_hasIdentity | SSH | N | N | Deprecated |
shh_newGroup | SSH | N | N | Deprecated |
shh_addToGroup | SSH | N | N | Deprecated |
shh_newFilter | SSH | N | N | Deprecated |
shh_uninstallFilter | SSH | N | N | Deprecated |
shh_getFilterChanges | SSH | N | N | Deprecated |
shh_getMessages | SSH | N | N | Deprecated |
admin_addPeer | Admin | N | N | Returns undefined |
admin_removePeer | Admin | N | N | Returns undefined |
admin_datadir | Admin | N | N | Returns undefined |
admin_nodeInfo | Admin | N | N | Returns undefined |
admin_peers | Admin | N | N | Returns undefined |
admin_startHTTP | Admin | N | N | Returns undefined |
admin_startWS | Admin | N | N | Returns undefined |
admin_stopHTTP | Admin | N | N | Returns undefined |
admin_stopWS | Admin | N | N | Returns undefined |
admin_addTrustedPeer | Admin | N | N | Returns undefined |
admin_removeTrustedPeer | Admin | N | N | Returns undefined |
admin_startRPC | Admin | N | N | Returns undefined |
admin_stopRPC | Admin | N | N | Returns undefined |
admin_exportChain | Admin | N | N | Returns undefined |
admin_importChain | Admin | N | N | Returns undefined |
admin_sleepBlocks | Admin | N | N | Returns undefined |
admin_clearPeerBanList | Admin | N | N | Returns undefined |
admin_listPeerBanList | Admin | N | N | Returns undefined |
clique_getSnapshot | Clique | N | N | Returns undefined |
clique_getSnapshotAtHash | Clique | N | N | Returns undefined |
clique_getSigners | Clique | N | N | Returns undefined |
clique_getSignersAtHash | Clique | N | N | Returns undefined |
clique_propose | Clique | N | N | Returns undefined |
clique_discard | Clique | N | N | Returns undefined |
clique_status | Clique | N | N | Returns undefined |
clique_getSigner | Clique | N | N | Returns undefined |
debug_backtraceAt | Debug | N | N | Returns undefined |
debug_blockProfile | Debug | Y | N | |
debug_cpuProfile | Debug | Y | N | |
debug_dumpBlock | Debug | N | N | Returns undefined |
debug_gcStats | Debug | Y | N | |
debug_getBlockRlp | Debug | N | N | Requires uint64 param |
debug_goTrace | Debug | Y | N | |
debug_freeOSMemory | Debug | Y | N | |
debug_memStats | Debug | Y | N | |
debug_mutexProfile | Debug | Y | N | |
debug_seedHash | Debug | N | N | Not implemented |
debug_setHead | Debug | N | N | Not implemented |
debug_setBlockProfileRate | Debug | Y | N | |
debug_setGCPercent | Debug | Y | N | |
debug_setMutexProfileFraction | Debug | Y | N | |
debug_stacks | Debug | Y | N | |
debug_startCPUProfile | Debug | Y | N | |
debug_startGoTrace | Debug | Y | N | |
debug_stopCPUProfile | Debug | Y | N | |
debug_stopGoTrace | Debug | Y | N | |
debug_traceBlock | Debug | Y | N | |
debug_traceBlockByNumber | Debug | Y | N | |
debug_traceBlockByHash | Debug | Y | N | |
debug_traceBlockFromFile | Debug | N | N | Returns undefined |
debug_standardTraceBlockToFile | Debug | N | N | Returns undefined |
debug_standardTraceBadBlockToFile | Debug | N | N | Returns undefined |
debug_traceTransaction | Debug | Y | N | |
debug_traceCall | Debug | Y | N | |
debug_traceChain | Debug | N | N | Returns undefined |
debug_traceBadBlock | Debug | N | N | Returns undefined |
debug_verbosity | Debug | N | N | Not implemented |
debug_vmodule | Debug | N | N | Not implemented |
debug_writeBlockProfile | Debug | Y | N | |
debug_writeMemProfile | Debug | Y | N | |
debug_writeMutexProfile | Debug | Y | N | |
debug_getRawBlock | Debug | N | N | Not implemented |
debug_getRawHeader | Debug | N | N | Not implemented |
debug_getRawReceipts | Debug | N | N | Not implemented |
debug_getRawTransaction | Debug | N | N | Not implemented |
debug_printBlock | Debug | Y | N | |
debug_getHeaderRlp | Debug | N | N | Requires uint64 param |
debug_intermediateRoots | Debug | Y | N | Returns empty hash |
debug_getBadBlocks | Debug | N | N | Not implemented |
debug_storageRangeAt | Debug | N | N | Not implemented |
debug_getModifiedAccountsByNumber | Debug | N | N | Not implemented |
debug_getModifiedAccountsByHash | Debug | N | N | Not implemented |
les_serverInfo | Les | N | N | Returns undefined |
les_clientInfo | Les | N | N | Returns undefined |
les_priorityClientInfo | Les | N | N | Returns undefined |
les_addBalance | Les | N | N | Returns undefined |
les_setClientParams | Les | N | N | Returns undefined |
les_setDefaultParams | Les | N | N | Returns undefined |
les_latestCheckpoint | Les | N | N | Returns undefined |
les_getCheckpoint | Les | N | N | Returns undefined |
les_getCheckpointContractAddress | Les | N | N | Returns undefined |
txpool_content | TxPool | Y | Y | See experimental mempool |
txpool_contentFrom | TxPool | Y | Y | See experimental mempool |
txpool_inspect | TxPool | Y | Y | See experimental mempool |
txpool_status | TxPool | Y | Y | See experimental mempool |
trace_callMany | Trace | N | N | Not implemented |
eth_signTypedData | Eth | W | N | EIP-712 partial |
eth_fillTransaction | Eth | Y | Y | |
eth_getTransactionLogs | Eth | Y | Y | Cosmos-specific |
miner_start | Miner | N | N | Returns undefined |
miner_stop | Miner | N | N | Returns undefined |
miner_setEtherbase | Miner | N | N | Returns undefined |
miner_setGasPrice | Miner | N | N | Returns undefined |
miner_setGasLimit | Miner | N | N | Returns undefined |
miner_setExtra | Miner | N | N | Returns undefined |
miner_setRecommitInterval | Miner | N | N | Returns undefined |
miner_getHashrate | Miner | N | N | Returns undefined |
engine_newPayloadV1 | Engine | N | N | Returns undefined |
engine_newPayloadV2 | Engine | N | N | Returns undefined |
engine_newPayloadV3 | Engine | N | N | Returns undefined |
engine_forkchoiceUpdatedV1 | Engine | N | N | Returns undefined |
engine_forkchoiceUpdatedV2 | Engine | N | N | Returns undefined |
engine_forkchoiceUpdatedV3 | Engine | N | N | Returns undefined |
engine_getPayloadV1 | Engine | N | N | Returns undefined |
engine_getPayloadV2 | Engine | N | N | Returns undefined |
engine_getPayloadV3 | Engine | N | N | Returns undefined |
engine_exchangeCapabilities | Engine | N | N | Returns undefined |
engine_exchangeTransitionConfigurationV1 | Engine | N | N | Returns undefined |
engine_getPayloadBodiesByHashV1 | Engine | N | N | Returns undefined |
engine_getPayloadBodiesByRangeV1 | Engine | N | N | Returns undefined |
engine_getBlobsV1 | Engine | N | N | Returns undefined |
trace_call | Trace | N | N | Not implemented |
trace_rawTransaction | Trace | N | N | Not implemented |
trace_replayBlockTransactions | Trace | N | N | Not implemented |
trace_replayTransaction | Trace | N | N | Not implemented |
trace_block | Trace | N | N | Not implemented |
trace_filter | Trace | N | N | Not implemented |
trace_get | Trace | N | N | Not implemented |
trace_transaction | Trace | N | N | Not implemented |
Block Number can be entered as a Hex string,
"earliest", "latest" or "pending".EIP-1559 Support: Cosmos EVM supports EIP-1559 transaction types with
eth_maxPriorityFeePerGas, though eth_feeHistory is not yet implemented.Consensus Differences: Due to using ‘CometBFT’ BFT consensus instead of Proof of Work/Stake:- Uncle-related methods always return 0 or null
- Block reorganizations are not possible
- Engine API (
engine_*) is not applicable - ‘CometBFT’ handles consensus
eth_createAccessList(EIP-2930) - Access list transactionseth_feeHistory- Fee history for EIP-1559eth_getFilterChanges/eth_getFilterLogs- Filter management issueseth_fillTransaction- Transaction filling utilityeth_resend- Transaction resending utilitypersonal_sendTransaction/personal_ecRecover- Personal namespace methodspersonal_lockAccount- Always returns false (not supported)debug_getRaw*methods - Raw data access methodsdebug_printBlock- Block printing utilitytrace_*methods - Advanced tracing featuresengine_*methods - Post-merge Engine API (uses ‘CometBFT’ instead)admin_*methods - Node administrationles_*methods - Light Ethereum Subprotocolclique_*methods - Proof of Authority consensus
eth_getProof- Requires block height > 2eth_signTypedData(EIP-712) - Partial implementationeth_subscribe- Works for newHeads, logs, and newPendingTransactions but not syncingpersonal_unlockAccount- Always returns falsedebug_traceTransaction- Has issues with block height
Examples
Below is a list of the RPC methods, the parameters and an example response from the namespaces.Web3 Methods
web3_clientVersion
Get the web3 client version.
Parameters (0)
Result
Client Examples
Shell HTTPweb3_sha3
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
Parameters (1)
1: inputhexutil.Bytes
- Required: [Y] Yes
Result
Client Examples
Shell HTTPNet Methods
net_version
Returns the current network id.
net_peerCount
Returns the number of peers currently connected to the client.
net_listening
Returns if client is actively listening for network connections.
Eth Methods
eth_protocolVersion
Returns the current ethereum protocol version.
eth_syncing
The sync status object may need to be different depending on the details of cometbft’s sync protocol. However, the ‘synced’ result is simply a boolean, and can easily be derived from cometbft’s internal sync state.
eth_gasPrice
Returns the current gas price in the default EVM denomination parameter.
eth_accounts
Returns array of all eth accounts.
eth_blockNumber
Returns the current block height.
eth_getBalance
Returns the account balance for a given account address and Block Number.
Parameters
- Account Address
- Block Number or Block Hash (EIP-1898)
eth_getStorageAt
Returns the storage address for a given account address.
Parameters
- Account Address
- Integer of the position in the storage
- Block Number or Block Hash (EIP-1898)
eth_getTransactionCount
Returns the total transaction for a given account address and Block Number.
Parameters
- Account Address
- Block Number or Block Hash (EIP-1898)
eth_getBlockTransactionCountByNumber
Returns the total transaction count for a given block number.
Parameters
- Block number
eth_getBlockTransactionCountByHash
Returns the total transaction count for a given block hash.
Parameters
- Block Hash
eth_getCode
Returns the code for a given account address and Block Number.
Parameters
- Account Address
- Block Number or Block Hash (EIP-1898)
eth_sign
The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).
By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.
Parameters
- Account Address
- Message to sign
eth_signTypedData
Signs typed structured data according to EIP-712. This method provides a more secure way to sign structured data compared to eth_sign.
Parameters
- Account Address (20 bytes)
- Typed data object containing:
domain: EIP-712 domain separatortypes: Type definitionsprimaryType: Primary type namemessage: Message to sign
eth_sendTransaction
Sends transaction from given account to a given account.
Parameters
-
Object containing:
from:DATA, 20 Bytes - The address the transaction is send from.to:DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas: QUANTITY - (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice: QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gasvalue: QUANTITY - value sent with this transactiondata:DATA- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI.nonce: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
eth_sendRawTransaction
Creates new message call transaction or a contract creation for signed transactions. You can get signed transaction data using the personal_sign method.
Parameters
- The signed transaction data
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
Parameters
-
Object containing:
from:DATA, 20 Bytes - (optional) The address the transaction is sent from.to:DATA, 20 Bytes - The address the transaction is directed to.gas: QUANTITY - gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.gasPrice: QUANTITY - gasPrice used for each paid gasvalue: QUANTITY - value sent with this transactiondata:DATA- (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation - Block number or Block Hash (EIP-1898)
eth_createAccessList
Creates an access list for a transaction. Access lists specify which addresses and storage keys a transaction will access, potentially reducing gas costs for complex transactions.
Implementation: rpc/backend/tx_info.go:396
Parameters
-
Object containing transaction data:
from:DATA, 20 Bytes - (optional) The address the transaction is sent fromto:DATA, 20 Bytes - The address the transaction is directed togas:QUANTITY- (optional) Gas provided for executiongasPrice:QUANTITY- (optional) Gas price for each unit of gasvalue:QUANTITY- (optional) Value sent with the transactiondata:DATA- (optional) Transaction data payload
- Block number or Block Hash (EIP-1898)
Returns
- Object containing:
accessList: Array of access list entriesaddress:DATA, 20 Bytes - Account addressstorageKeys: Array ofDATA- Storage keys accessed
gasUsed:QUANTITY- Gas used for execution with access list
Client Examples
Shell HTTPResult
Usage Example
eth_estimateGas
Returns an estimate value of the gas required to send the transaction.
Parameters
-
Object containing:
from:DATA, 20 Bytes - The address the transaction is send from.to:DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.value:QUANTITY- value sent with this transaction
eth_getBlockByNumber
Returns information about a block by block number.
Parameters
- Block Number
- If true it returns the full transaction objects, if false only the hashes of the transactions.
eth_getBlockByHash
Returns the block info given the hash found in the command above and a bool.
Parameters
- Hash of a block.
- If true it returns the full transaction objects, if false only the hashes of the transactions.
eth_getHeaderByHash
Returns block header information by block hash. The header contains metadata about the block without the full transaction list.
Implementation: rpc/backend/headers.go:21
Parameters
DATA, 32 Bytes - Hash of a block
Returns
- Object - Block header object containing:
parentHash:DATA, 32 Bytes - Hash of the parent blocksha3Uncles:DATA, 32 Bytes - SHA3 of the uncles data in the blockminer:DATA, 20 Bytes - Address of the block minerstateRoot:DATA, 32 Bytes - Root of the state trietransactionsRoot:DATA, 32 Bytes - Root of the transaction triereceiptsRoot:DATA, 32 Bytes - Root of the receipts trielogsBloom:DATA, 256 Bytes - Bloom filter for block logsdifficulty:QUANTITY- Difficulty for this blocknumber:QUANTITY- Block numbergasLimit:QUANTITY- Maximum gas allowed in this blockgasUsed:QUANTITY- Total gas used by all transactionstimestamp:QUANTITY- Unix timestamp when block was createdextraData:DATA- Extra data field of this blockmixHash:DATA, 32 Bytes - Mix hashnonce:DATA, 8 Bytes - Proof-of-work hashbaseFeePerGas:QUANTITY- Base fee per gas (EIP-1559)hash:DATA, 32 Bytes - Hash of the block
Client Examples
Shell HTTPResult
eth_getHeaderByNumber
Returns block header information by block number. Similar to eth_getHeaderByHash but accepts a block number instead of a hash.
Implementation: rpc/backend/headers.go:13
Parameters
- Block number as
QUANTITY(hex string) or block tag:"latest"- Latest mined block"earliest"- Genesis block"pending"- Pending state/transactions
Returns
- Object - Block header object (same structure as
eth_getHeaderByHash)
Client Examples
Shell HTTPResult
eth_getTransactionByHash
Returns transaction details given the ethereum tx something.
Parameters
- hash of a transaction
eth_getTransactionByBlockHashAndIndex
Returns transaction details given the block hash and the transaction index.
Parameters
- Hash of a block.
- Transaction index position.
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
Note: Tx Code from CometBFT and the Ethereum receipt status are switched:
| CometBFT | Ethereum | |
|---|---|---|
| Success | 0 | 1 |
| Fail | 1 | 0 |
Parameters
- Hash of a transaction
eth_newFilter
Create new filter using topics of some kind.
Parameters
- hash of a transaction
eth_newBlockFilter
Creates a filter in the node, to notify when a new block arrives.
eth_newPendingTransactionFilter
Creates a filter in the node, to notify when new pending transactions arrive.
eth_uninstallFilter
Removes the filter with the given filter id. Returns true if the filter was successfully uninstalled, otherwise false.
Parameters
- The filter id
eth_getFilterChanges
Polling method for a filter, which returns an array of logs which occurred since last poll.
Parameters
- The filter id
eth_getFilterLogs
Returns an array of all logs matching filter with given id.
Parameters
QUANTITY- The filter id
eth_getLogs
Returns an array of all logs matching a given filter object.
Parameters
-
Object containing:
fromBlock:QUANTITY|TAG- (optional, default:"latest") Integer block number, or"latest"for the last mined block or"pending","earliest"for not yet mined transactions.toBlock:QUANTITY|TAG- (optional, default:"latest") Integer block number, or"latest"for the last mined block or"pending","earliest"for not yet mined transactions.address:DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.topics: Array ofDATA, - (optional) Array of 32 BytesDATAtopics. Topics are order-dependent. Each topic can also be an array ofDATAwith “or” options.blockhash: (optional, future) With the addition of EIP-234,blockHashwill be a new filter option which restricts the logs returned to the single block with the 32-byte hashblockHash. UsingblockHashis equivalent tofromBlock=toBlock= the block number with hashblockHash. IfblockHashis present in in the filter criteria, then neitherfromBlocknortoBlockare allowed.
eth_coinbase
Returns the account the mining rewards will be send to.
eth_mining
Returns whether the client is actively mining new blocks.
Always returns
false as Cosmos EVM uses ‘CometBFT’ consensus instead of mining.eth_hashrate
Returns the number of hashes per second that the node is mining with.
Always returns
0x0 as Cosmos EVM uses ‘CometBFT’ consensus instead of mining.eth_chainId
Returns the chain ID used for signing replay-protected transactions.
eth_getUncleCountByBlockHash
Returns the number of uncles in a block matching the given block hash.
Always returns
0x0 as Cosmos EVM does not have uncles due to using ‘CometBFT’ consensus.Parameters
- Block hash
eth_getUncleCountByBlockNumber
Returns the number of uncles in a block matching the given block number.
Always returns
0x0 as Cosmos EVM does not have uncles due to using ‘CometBFT’ consensus.Parameters
- Block number
eth_getUncleByBlockHashAndIndex
Returns information about an uncle by block hash and uncle index position.
Always returns
null as Cosmos EVM does not have uncles due to using ‘CometBFT’ consensus.Parameters
- Block hash
- Uncle index position
eth_getUncleByBlockNumberAndIndex
Returns information about an uncle by block number and uncle index position.
Always returns
null as Cosmos EVM does not have uncles due to using ‘CometBFT’ consensus.Parameters
- Block number
- Uncle index position
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
Parameters
- Block number
- Transaction index position
eth_maxPriorityFeePerGas
Returns the current maxPriorityFeePerGas per gas in wei.
eth_getBlockReceipts
Returns all transaction receipts for a given block.
Parameters
- Block number or block hash
eth_getTransactionLogs
Returns the logs for a specific transaction.
Parameters
- Transaction hash
eth_fillTransaction
Fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to the caller for further processing (signing + broadcast).
Parameters
- Transaction object with optional fields
eth_resend
Resends a transaction with updated gas parameters. Removes the given transaction from the pool and reinserts it with the new gas price and limit.
Parameters
- Original transaction object (must include
nonce) - New gas price (hex)
- New gas limit (hex)
eth_getProof
Returns the account- and storage-values of the specified account including the Merkle-proof.
Parameters
- Address of account or contract
- Array of storage positions (32-byte storage slot)
- Block Number (must be a specific number, not “latest”)
WebSocket Methods
Read more about using websockets.eth_subscribe
subscribe using JSON-RPC notifications. This allows clients to wait for events instead of polling for them. It works by subscribing to particular events. The node will return a subscription id. For each event that matches the subscription a notification with relevant data is send together with the subscription id.
Parameters
- Subscription Name
- Optional Arguments
eth_unsubscribe
Unsubscribe from an event using the subscription id
Parameters
- Subscription ID
Personal Methods
personal_importRawKey
Private: Requires authentication.
Parameters (2)
1: privkeystring
- Required: [Y] Yes
- Format: 64 hex characters (32 bytes) without “0x” prefix
string
- Required: [Y] Yes
personal_listAccounts
Private: Requires authentication.
personal_lockAccount
Private: Requires authentication.
Parameters
- Account Address
personal_newAccount
Private: Requires authentication.
Parameters
- Passphrase
personal_unlockAccount
Private: Requires authentication.
eth_sign and eth_sendTransaction while it is unlocked.
Parameters
- Account Address
- Passphrase
- Duration
personal_sendTransaction
Private: Requires authentication.
eth_sendTransaction and contains the from address. If the passphrase can be used to decrypt the private key belonging to tx.from the transaction is verified, signed and send onto the network.
Parameters
-
Object containing:
from:DATA, 20 Bytes - The address the transaction is send from.to:DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.value: QUANTITY - value sent with this transaction - Passphrase
personal_sign
Private: Requires authentication.
sign(keccack256("\x19Ethereum Signed Message:\n" + len(message) + message))),
Parameters
- Message
- Account Address
- Password
personal_ecRecover
Private: Requires authentication.
ecRecover returns the address associated with the private key that was used to calculate the signature in personal_sign.
Parameters
- Message (hex encoded)
- Signature returned from
personal_sign(65 bytes)
personal_initializeWallet
Private: Requires authentication.
Parameters (1)
Parameters must be given by position. 1: urlstring
- Required: [Y] Yes
Client Examples
Shell HTTPpersonal_unpair
Private: Requires authentication.
Parameters (2)
- URL
- Pairing password
Client Examples
Shell HTTPpersonal_listWallets
Private: Requires authentication.
Currently returns
null as wallet-level management is not supported.Debug Methods
debug_traceTransaction
The traceTransaction debugging method will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction that corresponds to the given hash.
Parameters
- Trace Config
debug_traceBlockByNumber
The traceBlockByNumber endpoint accepts a block number and will replay the block that is already present in the database.
Stub Implementation: This method is implemented but currently returns an empty array for all requests. The tracing functionality is not fully operational in Cosmos EVM.
Parameters
- Block number (hex string)
- Trace Config (optional)
debug_traceBlockByHash
Similar to debug_traceBlockByNumber, this method accepts a block hash and will replay the block that is already present in the database.
Stub Implementation: This method is implemented but currently returns an empty array for all requests. The tracing functionality is not fully operational in Cosmos EVM.
Parameters
- Block hash (32-byte hash)
- Trace Config (optional)
debug_traceCall
Traces the execution of an eth_call within the context of a given block. This allows you to simulate a transaction and trace its execution without broadcasting it to the network.
Implementation: rpc/namespaces/ethereum/debug/api.go:158
Parameters
-
Object containing transaction call data:
from:DATA, 20 Bytes - (optional) The address the call is sent fromto:DATA, 20 Bytes - The address the call is directed togas:QUANTITY- (optional) Gas provided for the call executiongasPrice:QUANTITY- (optional) Gas price for each unit of gasvalue:QUANTITY- (optional) Value sent with the calldata:DATA- (optional) Call data payload
- Block number or Block Hash (EIP-1898)
-
Tracer configuration (optional) - Object containing:
tracer:string- Tracer type (“callTracer”, “prestateTracer”, “4byteTracer”, or custom JavaScript tracer)timeout:string- Timeout for trace execution (e.g., “5s”)tracerConfig: Object - Tracer-specific configuration options
Returns
- Object - Trace result structure depends on the tracer used:
- callTracer: Returns call frame tree with gas usage and sub-calls
- prestateTracer: Returns pre-state (account balances, nonces, code, storage)
- 4byteTracer: Returns map of 4-byte function selectors to call counts
- opcodeTracer: Returns list of executed opcodes
Client Examples
Shell HTTPResult
Usage Examples
debug_freeOSMemory
Forces the Go runtime to perform a garbage collection and return unused memory to the OS.
Private: Requires authentication.
debug_setGCPercent
Sets the garbage collection target percentage. A negative value disables garbage collection.
Private: Requires authentication.
Parameters
- GC percentage (integer)
debug_memStats
Returns detailed runtime memory statistics.
Private: Requires authentication.
debug_setBlockProfileRate
Sets the rate of goroutine block profile data collection. A non-zero value enables block profiling.
Private: Requires authentication.
Parameters
- Profile rate (integer)
debug_writeBlockProfile
Writes a goroutine blocking profile to the specified file.
Private: Requires authentication.
Parameters
- File path (string)
debug_writeMemProfile
Writes an allocation profile to the specified file.
Private: Requires authentication.
Parameters
- File path (string)
debug_writeMutexProfile
Writes a mutex contention profile to the specified file.
Private: Requires authentication.
Parameters
- File path (string)
debug_blockProfile
Turns on block profiling for the given duration and writes the profile data to disk.
Private: Requires authentication.
Parameters
- File path (string) - Output file for the profile
- Duration in seconds (number)
debug_cpuProfile
Turns on CPU profiling for the given duration and writes the profile data to disk.
Private: Requires authentication.
Parameters
- File path (string) - Output file for the profile
- Duration in seconds (number)
debug_gcStats
Returns garbage collection statistics.
Private: Requires authentication.
Cosmos-specific: This method is unique to Cosmos EVM.
debug_goTrace
Turns on Go runtime tracing for the given duration and writes the trace data to disk.
Private: Requires authentication.
Parameters
- File path (string) - Output file for the trace
- Duration in seconds (number)
debug_stacks
Returns a printed representation of the stacks of all goroutines.
Private: Requires authentication.
debug_startCPUProfile
Starts indefinite CPU profiling, writing to the given file.
Private: Requires authentication.
Parameters
- File path (string) - Output file for the profile
debug_stopCPUProfile
Stops an ongoing CPU profile.
Private: Requires authentication.
debug_mutexProfile
Turns on mutex profiling for the given duration and writes the profile data to disk.
Private: Requires authentication.
Parameters
- File path (string) - Output file for the profile
- Duration in seconds (number)
debug_setMutexProfileFraction
Sets the rate of mutex profiling.
Private: Requires authentication.
Cosmos-specific: This method is unique to Cosmos EVM.
Parameters
- Rate (number) - 0 to disable, 1 for full profiling
debug_getHeaderRlp
Returns the RLP encoding of the header of the block.
Private: Requires authentication.
Parameters
- Block number (uint64 number, not hex string)
debug_getBlockRlp
Returns the RLP encoding of the block.
Private: Requires authentication.
Parameters
- Block number (uint64 number, not hex string)
debug_printBlock
Returns a formatted string of the block.
Private: Requires authentication.
Parameters
- Block number (uint64 number, not hex string)
debug_intermediateRoots
Returns the intermediate state roots for a transaction.
Private: Requires authentication.
Parameters
- Transaction hash (hash)
- Trace config (object, optional)
TxPool Methods
txpool_content
Returns a list of the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Parameters (0)
Client Examples
Shell HTTPResult
txpool_contentFrom
Returns transactions from a specific address that are currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Parameters (1)
address- The address to filter transactions from (20 bytes)
Client Examples
Shell HTTPResult
txpool_inspect
Returns a list on text format to summarize all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. This is a method specifically tailored to developers to quickly see the transactions in the pool and find any potential issues.
Parameters (0)
Client Examples
Shell HTTPResult
txpool_status
Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Parameters (0)
Client Examples
Shell HTTPResult
eth_createAccessList
This method is fully implemented and supports EIP-2930 access list transactions.
Parameters
-
Transaction Object - The transaction call object
from:DATA, 20 Bytes - (optional) The address the transaction is sent fromto:DATA, 20 Bytes - The address the transaction is directed togas:QUANTITY- (optional) Integer of the gas provided for the transaction executiongasPrice:QUANTITY- (optional) Integer of the gasPrice used for each paid gasmaxFeePerGas:QUANTITY- (optional) Maximum fee per gas the sender is willing to paymaxPriorityFeePerGas:QUANTITY- (optional) Maximum priority fee per gas the sender is willing to payvalue:QUANTITY- (optional) Integer of the value sent with this transactiondata:DATA- (optional) Hash of the method signature and encoded parametersaccessList:ARRAY- (optional) List of addresses and storage keys the transaction plans to access
-
Block Parameter -
QUANTITY|TAG- integer block number, or the string “latest”, “earliest” or “pending”
Client Examples
Shell HTTPResult
Return Values
accessList:ARRAY- List of addresses and storage keys used by the transactionaddress:DATA, 20 Bytes - Address accessed by the transactionstorageKeys:ARRAY- Array of storage keys accessed at this address
gasUsed:QUANTITY- Estimated gas consumed by the transaction with the access list