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:
@@ -56,20 +56,15 @@ export async function getTokenMint(): Promise<PublicKey | null> {
|
||||
|
||||
// Auto-create mint on devnet if authority exists
|
||||
if (mintAuthority && RPC_URL.includes("devnet")) {
|
||||
console.log("Auto-creating token mint on devnet...");
|
||||
|
||||
try {
|
||||
// Fund mint authority with SOL first
|
||||
const balance = await connection.getBalance(mintAuthority.publicKey);
|
||||
if (balance < 500000000) {
|
||||
console.log(
|
||||
`Airdropping SOL to mint authority ${mintAuthority.publicKey.toBase58()}...`,
|
||||
);
|
||||
const signature = await connection.requestAirdrop(
|
||||
mintAuthority.publicKey,
|
||||
2 * 1000000000,
|
||||
);
|
||||
await connection.confirmTransaction(signature);
|
||||
console.log("Airdrop complete");
|
||||
}
|
||||
|
||||
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`,
|
||||
);
|
||||
return mint;
|
||||
} catch {
|
||||
// Devnet faucet rate-limited, will use DB-only credits
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user