1

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 1

1

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();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.