Skip to main content
added 61 characters in body
Source Link

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically (eg in a unit test or another script that is ran frequently)

I'd suggest airdropIfRequired from the @solana-developers/helpers repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically

I'd suggest airdropIfRequired from the @solana-developers/helpers repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically (eg in a unit test or another script that is ran frequently)

I'd suggest airdropIfRequired from the @solana-developers/helpers repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator
added 113 characters in body
Source Link

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically

I'd suggest airdropIfRequired from the @solana-developers/helpers repository**repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually bothercontact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

JustRemember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically

I'd suggest airdropIfRequired from the @solana-developers/helpers repository**. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually bother the faucet if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Just fire up a local validator where there are no airdrop limits!

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically

I'd suggest airdropIfRequired from the @solana-developers/helpers repository. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually contact the faucet (and hence not affect your rate limit) if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Remember you only need Airdrops on devnet! If you don't want to test in Devnet just fire up a local validator where there are no airdrop limits!

solana-test-validator
Source Link

Abdullah's answer is excellent, but I wanted to add:

If you're airdropping on devnet automatically

I'd suggest airdropIfRequired from the @solana-developers/helpers repository**. This allows you to continue to get airdrops if you need them (say when running unit tests) but not actually bother the faucet if you already have enough SOL:

const newBalance = await airdropIfRequired(
  connection,
  keypair.publicKey,
  0.5 * LAMPORTS_PER_SOL,
  1 * LAMPORTS_PER_SOL,
);

If you don't actually need devnet

Just fire up a local validator where there are no airdrop limits!