Verify the Solana cluster before switching RPC endpoints
An endpoint can answer promptly while pointing at a different cluster. A genesis-hash check catches this mistake before a worker writes chain data under the wrong network.
Pin the expected cluster identity
During setup, read the genesis hash from an independently trusted endpoint for the intended cluster. Store the full base58 string in the network configuration. Send the same request to every proposed failover target.
{
"jsonrpc": "2.0",
"id": 1,
"method": "getGenesisHash",
"params": []
}
Handle a mismatch during cutover
If A returns the pinned value and B returns a different one, keep B out of this cluster’s rotation. Check whether its URL points to a development network, a local validator, or a proxy upstream for another environment. Recheck after the routing correction.
The genesis hash identifies the cluster’s origin. A lagging node on the intended network can return exactly the expected value. Check slot freshness separately before moving traffic to the endpoint.