We can use solana airdrop 1 <my pubkey>
to request an airdrop with the solana cli. Is there a way we can do this in rust/with anchor_client
directly?
1 Answer
Nevermind, figured it out:
/// Replace with devnet or whichever cluster you're currently on
let rpc = RpcClient::new(Cluster::Localnet.url());
let sig = rpc.request_airdrop(pubkey, lamports).unwrap();