Solana
Solana
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Every Solana transaction must reference a recent blockhash so the cluster can reject stale or replayed submissions, and getLatestBlockhash is how you obtain one. It returns the current blockhash together with lastValidBlockHeight — the block height past which a transaction built on that blockhash can no longer land. With Solana's ~400ms slots a blockhash ages quickly, so most senders of SOL or SPL token transactions fetch one immediately before signing. Call it on TheRPC at https://solana.therpc.io/YOUR_API_KEY.
blockhash to embed in a transaction message right before you sign and submit a SOL transfer or program call.lastValidBlockHeight as the hard deadline after which the cluster will drop the transaction.sendTransaction until the current block height passes lastValidBlockHeight, then gives up and re-signs with a new blockhash.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | config | object | لا | Options: commitment, minContextSlot. |
| النوع | الوصف |
|---|---|
| object | RpcResponse wrapping { blockhash, lastValidBlockHeight }. |
| الكود | الرسالة | السبب |
|---|---|---|
-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. |
lastValidBlockHeight against the live height from getBlockHeight to know when a pending transaction is dead, so you stop polling getSignatureStatuses for a signature that can never confirm.