Does Solana use Chain IDs the way they are used in EVM blockchains? I cannot find this in the Solana documentation and in the internet. If Solana uses Chain IDs, where can I find them? If not, is there a generally accepted way of distinguishing networks?
1 Answer
You can read about different clusters which Solana maintains.
To fulfil different JSON-RPC requests to the same, endpoints are listed here.
You can open a request to any of them by creating a connection and a provider. In JavaScript, you can connect to the "devnet" cluster by doing the following :
import { clusterApiUrl , Connection } from "@solana/web3.js";
const networkUrl = "https://api.devnet.solana.com"; // RPC Endpoint
const connection = new Connection(networkUrl);