Solana
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
getBlockHeight returns the current block height of Solana, the Proof-of-History and Proof-of-Stake network whose native token is SOL. Block height counts the blocks that have actually been produced, which is distinct from the slot number: Solana mints a new slot roughly every 400 ms, but skipped slots produce no block, so height always trails the latest slot. The method is most often used to compare against a transaction's lastValidBlockHeight and decide whether that transaction can still land before its recent blockhash expires. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST; the optional config object accepts commitment and minContextSlot.
lastValidBlockHeight to know exactly when that transaction can no longer be confirmed and should be rebuilt with a fresh blockhash.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | config | object | لا | Options: commitment, minContextSlot. |
| النوع | الوصف |
|---|---|
| integer | u64 current block height. |
| الكود | الرسالة | السبب |
|---|---|---|
-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 that matches how settled you need the value to be: processed for the freshest read, confirmed for a typical app, or finalized when the height must be irreversible.