chore(solana): silence devnet airdrop retry spam

Catch and swallow airdrop errors quietly. Logs were flooded with
429 retry messages. Now fails fast and lets DB-only credits take
over when devnet faucet is dry.
This commit is contained in:
2026-04-21 15:31:19 -04:00
parent 31d89f049b
commit 5dbee115ad
+5 -6
View File
@@ -56,20 +56,15 @@ export async function getTokenMint(): Promise<PublicKey | null> {
// Auto-create mint on devnet if authority exists // Auto-create mint on devnet if authority exists
if (mintAuthority && RPC_URL.includes("devnet")) { if (mintAuthority && RPC_URL.includes("devnet")) {
console.log("Auto-creating token mint on devnet..."); try {
// Fund mint authority with SOL first // Fund mint authority with SOL first
const balance = await connection.getBalance(mintAuthority.publicKey); const balance = await connection.getBalance(mintAuthority.publicKey);
if (balance < 500000000) { if (balance < 500000000) {
console.log(
`Airdropping SOL to mint authority ${mintAuthority.publicKey.toBase58()}...`,
);
const signature = await connection.requestAirdrop( const signature = await connection.requestAirdrop(
mintAuthority.publicKey, mintAuthority.publicKey,
2 * 1000000000, 2 * 1000000000,
); );
await connection.confirmTransaction(signature); await connection.confirmTransaction(signature);
console.log("Airdrop complete");
} }
const mintKeypair = Keypair.generate(); const mintKeypair = Keypair.generate();
@@ -87,6 +82,10 @@ export async function getTokenMint(): Promise<PublicKey | null> {
`Add SOLANA_MINT_ADDRESS=${mint.toBase58()} to your .env to persist it`, `Add SOLANA_MINT_ADDRESS=${mint.toBase58()} to your .env to persist it`,
); );
return mint; return mint;
} catch {
// Devnet faucet rate-limited, will use DB-only credits
return null;
}
} }
return null; return null;
} catch (error) { } catch (error) {