0

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 ?

J.erome
  • 688
  • 7
  • 26

2 Answers2

0

Simple solution:

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

Edit

benek
  • 2,088
  • 2
  • 26
  • 38
J.erome
  • 688
  • 7
  • 26
0

You can always check for Solana's current configuration using:

solana config get

After that check and make sure that the keypair your solana-cli is currently pointing to is actually the keypair you want in this case it might be pointing to the old keypair file

In order to change this use

solana config set --keypair <path_to_your_keypair>

For example

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

I hope this helps!