Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
getBlocks returns the list of slots that actually produced a confirmed block between a startSlot and an endSlot on Solana, the high-throughput Proof-of-Stake chain whose native token is SOL. Because Solana advances at roughly 400 ms per slot and not every slot yields a block, this method is how indexers find the real, non-empty slots to fetch rather than guessing slot numbers. The result is a plain array of u64 slot numbers; any slot in the range that is missing from the array was skipped. If you omit endSlot, it defaults to the latest slot. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST, then feed each returned slot into getBlock.
getBlock on a slot that has no data.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | startSlot | integer | 是 | First slot of the range. |
| 2 | endSlot | integer | 否 | Last slot of the range (defaults to the latest). |
| 3 | config | object | 否 | Options: commitment. |
| 类型 | 描述 |
|---|---|
| array | Array of u64 confirmed slot numbers in the range. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32004 | Block not available for slot | The slot is not in this node's ledger (purged, skipped, or behind first available block). Use an archival endpoint for deep history. |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
startSlot and endSlot is capped (around 500,000 slots). For wider history, chunk the request into successive ranges instead of asking for the whole span at once.