MCPcopy Create free account
hub / github.com/ExtropyIO/SolanaBootcamp / getRpcUrl

Function getRpcUrl

utils/utils.ts:139–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 * Load and parse the Solana CLI config file to determine which RPC url to use
138 */
139export async function getRpcUrl(): Promise<string> {
140 try {
141 const config = await getConfig();
142 if (!config.json_rpc_url) throw new Error("Missing RPC URL");
143 return config.json_rpc_url;
144 } catch (err) {
145 console.warn(
146 "Failed to read RPC url from CLI config file, falling back to localhost"
147 );
148 return "http://localhost:8899";
149 }
150}
151
152/**
153 * Checks if provided account is executable and returns the public key

Callers 1

establishConnectionFunction · 0.85

Calls 1

getConfigFunction · 0.85

Tested by

no test coverage detected