solanasolana-cli

Solana CLI: Use an other Phantom address


I configured Solana CLI with a wallet address and now I want to change it.

I did the following steps in order to swap to the new Phantom address I want to use :

$ solana-keygen recover 'prompt:?key=6/0' --outfile ~/.config/solana/id.json

then I inserted my seed phrase and finally I got this output :

Recovered pubkey Bw...35h. Continue? (y/n): y
Wrote recovered keypair to ~/.config/solana/id.json

which is exactly the address I want to use ! But then when I check using solana address or solana-keygen pubkey I keep getting the old address :

solana-keygen pubkey
63...95x

solana address
63...95x

What am I missing ?


Solution

  • Simple solution:

       solana config set -k ~/.config/solana/keypair.json 
    

    Edit