Polygon
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Polygon
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_syncing reports whether a Polygon PoS node is still catching up to the chain head. It returns false when the node is fully synced and serving current data, or an object with startingBlock, currentBlock, and highestBlock while it is still importing blocks. Because Polygon produces a block roughly every 2 seconds, a node that has fallen behind can lag by a large number of blocks quickly, so this check matters before you trust any balance or MATIC transaction it returns. Query it against the Polygon mainnet endpoint at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) to confirm the node backing your requests is current.
currentBlock and highestBlock to drive a node-monitoring dashboard.currentBlock over time — on a healthy Polygon node it should advance by roughly one block every 2 seconds.Cette méthode ne prend aucun paramètre. Passez un tableau vide [].
| Type | Description |
|---|---|
| boolean | object | false when the node is fully synced. When syncing, returns an object with at minimum: startingBlock (hex), currentBlock (hex), highestBlock (hex). Additional fields vary by client (e.g. Geth includes snap-sync progress counters; Erigon includes syncStage/syncProgress). |
Try it live in the Polygon playground.
| Code | Message | Cause |
|---|---|---|
-32603 | Internal error | Node cannot determine sync state (e.g. no peers connected). |
false during specific sync phases even when not fully caught up — do not treat false as an absolute guarantee; cross-check currentBlock against the expected head if correctness is critical.