Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
getSlot is a Solana JSON-RPC method that returns the current slot the node is processing on the chain that secures SOL. Solana advances roughly one slot every ~400ms, so this u64 is the live cursor of network time. You can pass an optional config object with a commitment (processed, confirmed, or finalized) and minContextSlot to control which view you get. Send it as a JSON-RPC 2.0 POST with positional params to https://solana.therpc.io/YOUR_API_KEY.
minContextSlot on later calls so they only run against a node that is at least this caught up.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | config | object | 否 | Options: commitment, minContextSlot. |
| 类型 | 描述 |
|---|---|
| integer | u64 current slot. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
commitment: processed advances fastest but is least settled and can be rolled back, while finalized is the most settled. Choose the level that matches your tolerance.