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

Function checkBinaryExists

utils/utils.ts:155–167  ·  view source on GitHub ↗
(
  PROGRAM_KEYPAIR_PATH: string
)

Source from the content-addressed store, hash-verified

153 * Checks if provided account is executable and returns the public key
154 */
155export async function checkBinaryExists(
156 PROGRAM_KEYPAIR_PATH: string
157): Promise<PublicKey> {
158 try {
159 const programKeypair = await createKeypairFromFile(PROGRAM_KEYPAIR_PATH);
160 return programKeypair.publicKey;
161 } catch (err) {
162 const errMsg = (err as Error).message;
163 throw new Error(
164 `Failed to read program keypair at '${PROGRAM_KEYPAIR_PATH}' due to error: ${errMsg}. Program may need to be deployed with \`solana program deploy dist/program/helloworld.so\``
165 );
166 }
167}
168
169/**
170 * Checks if provided account is executable

Callers 6

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
invokeFunction · 0.90

Calls 1

createKeypairFromFileFunction · 0.85

Tested by

no test coverage detected