Polygon
Polygon
Polygon
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_blockNumber returns the height of the most recently accepted block on Polygon PoS — the latest block sealed by a Bor producer. Because Polygon mines a new block roughly every 2 seconds, this value moves fast and is the simplest way to confirm your node is keeping up with the head of the chain. Gas on Polygon is paid in MATIC, but this call costs nothing on-chain: it is a pure read. Send it to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) and you get back the current block height as a hex string.
polygon.therpc.io is up and synced to the Polygon head.eth_getLogs over a historical range.Diese Methode erwartet keine Parameter. Übergib ein leeres Array [].
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Try it live in the Polygon playground.
| Code | Meldung | Ursache |
|---|---|---|
-32603 | Internal error | Node is not reachable or has not yet produced any block. |
0x3a1f2c, not a number — run parseInt(value, 16) or BigInt(value) before any arithmetic.