Ethereum
Ethereum
Ethereum
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_blockNumber returns the height of the most recent block the node has accepted on Ethereum mainnet. Since The Merge a validator proposes one block per 12-second slot, so under normal conditions the number this method reports climbs by one roughly every 12 seconds. It takes no parameters and answers with a single hex integer. Point it at https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1, native coin ETH) and you get the current tip of the canonical chain. It is the lightest call in the whole eth_ namespace.
eth_getLogs backward in fixed windows so you never request a range that runs past the head.current - txBlock crosses your confirmation threshold before treating a transaction as settled.finalized to see how many slots still sit in the reorg-able window above economic finality.此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Try it live in the Ethereum playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32603 | Internal error | Node is not reachable or has not yet produced any block. |
0x12d4f1a. Decode it with BigInt(value) or parseInt(value, 16); comparing or adding to the raw string gives garbage.finalized or safe instead of acting on the raw latest height.