Ethereum/Core API

Ethereum Core Methods

This section documents the core Ethereum JSON-RPC API methods that provide essential functionality for interacting with the Ethereum blockchain. These methods form the foundation of most Ethereum applications and development workflows.

Core Ethereum Methods (eth_)

These methods provide core functionality for interacting with the Ethereum blockchain, including account balances, transaction data, block information, and smart contract interactions.

方法调用HTTP!WS!
eth_blockNumber
返回当前区块号
eth_call
立即执行新的消息调用,而不创建交易
eth_chainId
返回当前网络的链ID
eth_estimateGas
生成并返回执行交易所需的gas估算
eth_feeHistory
返回请求区块范围的交易费用历史数据
eth_gasPrice
返回当前gas价格(以wei为单位)
eth_getBalance
返回给定地址的账户余额
eth_getBlockByHash
返回通过哈希指定的区块信息
eth_getBlockByNumber
返回通过区块号指定的区块信息
eth_getBlockReceipts
返回给定区块的所有交易收据
eth_getBlockTransactionCountByHash
返回通过哈希指定的区块中的交易数量
eth_getBlockTransactionCountByNumber
返回通过区块号指定的区块中的交易数量
eth_getCode
返回给定地址的已编译智能合约代码
eth_getFilterChanges
过滤器的轮询方法,返回自上次轮询以来发生的日志数组
eth_getFilterLogs
返回与给定ID的过滤器匹配的所有日志数组
eth_getLogs
返回匹配给定过滤条件的日志数组
eth_getProof
返回账户状态的merkle证明
eth_getStorageAt
返回给定地址处存储位置的值
eth_getTransactionByBlockHashAndIndex
通过区块哈希和交易索引返回交易信息
eth_getTransactionByBlockNumberAndIndex
通过区块号和交易索引返回交易信息
eth_getTransactionByHash
通过交易哈希返回交易详情
eth_getTransactionCount
返回从地址发送的交易数量(nonce)
eth_getTransactionReceipt
返回通过哈希指定的交易收据
eth_getUncleByBlockHashAndIndex
通过区块哈希和叔块索引返回叔块信息
eth_getUncleByBlockNumberAndIndex
通过区块号和叔块索引返回叔块信息
eth_getUncleCountByBlockHash
返回通过哈希指定的区块中的叔块数量
eth_getUncleCountByBlockNumber
返回通过区块号指定的区块中的叔块数量
eth_maxPriorityFeePerGas
返回当前最大优先费用每单位gas(以wei为单位)
eth_newBlockFilter
在节点中创建过滤器,以在新区块到达时通知
eth_newFilter
基于过滤器选项创建过滤器对象,以在状态更改时通知
eth_newPendingTransactionFilter
在节点中创建过滤器,以在新的待处理交易到达时通知
eth_sendRawTransaction
向网络提交原始交易
eth_subscribe
通过WebSocket为特定区块链事件创建订阅
eth_syncing
返回节点同步状态的信息
eth_uninstallFilter
卸载具有给定ID的过滤器
eth_unsubscribe
通过WebSocket取消现有订阅

Network Methods (net_)

These methods provide information about the network status and connections, helping developers monitor node connectivity and network configuration.

方法调用HTTP!WS!
net_listening
如果客户端正在主动监听网络连接,则返回true
net_peerCount
返回当前连接到客户端的对等节点数量
net_version
返回当前网络协议版本

Transaction Pool Methods (txpool_)

These methods allow inspection of the transaction pool status, providing visibility into pending transactions and mempool state.

方法调用HTTP!WS!
txpool_inspect
返回当前在交易池中待处理的交易的详细列表
txpool_status
返回当前待处理和排队的交易数量

Web3 Utility Methods (web3_)

Basic web3 utility methods for general blockchain interaction, including hashing and client information.

方法调用HTTP!WS!
web3_clientVersion
返回当前客户端版本
web3_sha3
返回给定数据的Keccak-256哈希

See also

帮助我们变得更好!
分享此页面并帮助我们为您创建更好的产品。