getRecentBlockhashConfig
Deprecated: The
getRecentBlockhashmethod is deprecated. UsegetLatestBlockhashinstead.
Note: This is not a standard Solana JSON-RPC method. It is a configuration reference helper. See the linked method above for the actual RPC endpoint.
This is not a standard Solana JSON-RPC method. It serves as a configuration reference for the deprecated getRecentBlockhash method. Since getRecentBlockhash itself is deprecated, new applications should use getLatestBlockhash which provides blockhash validity information through lastValidBlockHeight.
Parameters
This method does not accept any parameters.
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
Response
This is a configuration reference. See getRecentBlockhash for the response format (deprecated).
Code Examples
cURL
1curl http://[IP_ADDRESS]:[PORT] -X POST -H "Content-Type: application/json" -d '{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "method": "getRecentBlockhash",
5 "params": [
6 { "commitment": "finalized" }
7 ]
8}'TypeScript
1const response = await fetch("http://[IP_ADDRESS]:[PORT]", {
2 method: "POST",
3 headers: { "Content-Type": "application/json" },
4 body: JSON.stringify({
5 jsonrpc: "2.0",
6 id: 1,
7 method: "getRecentBlockhash",
8 params: [
9 { commitment: "finalized" }
10 ]
11 }),
12});
13const { result } = await response.json();
14console.log("Blockhash:", result.value.blockhash);Python
1import requests
2
3response = requests.post("http://[IP_ADDRESS]:[PORT]", json={
4 "jsonrpc": "2.0",
5 "id": 1,
6 "method": "getRecentBlockhash",
7 "params": [
8 {"commitment": "finalized"}
9 ]
10})
11result = response.json()["result"]
12print(f"Blockhash: {result['value']['blockhash']}")Rust
1use reqwest::Client;
2use serde_json::json;
3
4#[tokio::main]
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let client = Client::new();
7 let res = client.post("http://[IP_ADDRESS]:[PORT]")
8 .json(&json!({
9 "jsonrpc": "2.0",
10 "id": 1,
11 "method": "getRecentBlockhash",
12 "params": [
13 {"commitment": "finalized"}
14 ]
15 }))
16 .send().await?
17 .text().await?;
18 println!("{}", res);
19 Ok(())
20}Example Response
1{
2 "jsonrpc": "2.0",
3 "result": {
4 "context": { "slot": 123456789 },
5 "value": {
6 "blockhash": "GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ",
7 "feeCalculator": { "lamportsPerSignature": 5000 }
8 }
9 },
10 "id": 1
11}