Solana CLI - create second account based on random seed

How can I create 10 test account / wallets using Solana CLI (devnet) without requiring user input ?

I have tried this …

spl-token create-account ASK

But this prompts me to enter a seed phrase.

How can I do this without requiring user input

These are throwaway accounts.
I dont care about saving the seed phrase or private key for each account.
I just want to create 10 throwaway accounts so I can test transfer tokens to them

Thank you for any help that you can offer

If you have a bash terminal, either because you are on Linux, or because you have git or WSL installed on windows, you can do this to get 10 random addresses:

for i in $(seq 0 10); do echo "" | solana-keygen new --no-outfile 2> /dev/null | grep 'pubkey: ' | awk -F " " '{ print $2 }'; done

You don’t need to do spl-token create-account unless you want to specifically fund associated token accounts for those wallets. If you just want some wallet addresses to transfer to, then just solana-keygen new is enough.

Good one. Thank you Zicklag

1 Like