3

I'm trying to create a solana wallet using solana-keygen and then check it's balance With this line I create the wallet with the spesific outfile

C:\Users\Ali Berkin>solana-keygen new --force -o "C:\Users\Ali Berkin\Documents\Solana\test.json"

It generated the wallet successfully and outputted me this

Generating a new keypair

For added security, enter a BIP39 passphrase
NOTE! This passphrase improves security of the recovery seed phrase NOT the                                                                                                                                                  
keypair file itself, which is stored as insecure plain text
                                                                                                                                                              
BIP39 Passphrase (empty for none):                                                                                                                                                                                                                                                                                                  
Wrote new keypair to C:\Users\Ali Berkin\Documents\Solana\test.json                                                                                               
================================================================================                                                                                  
pubkey: CgvYXNqdVLvNvByFXiSkFGfRC3QFR9SGZq17Bq1bRdht                                                                                                              
================================================================================

then I saved this keypair as my default keypair

C:\Users\Ali Berkin>solana config set --keypair "C:\Users\Ali 
Berkin\Documents\Solana\test.json"                                                                  
Config File: C:\Users\Ali Berkin\.config\solana\cli\config.yml                                                                                                    
RPC URL: https://metaplex.devnet.rpcpool.com/                                                                                                                     
WebSocket URL: wss://metaplex.devnet.rpcpool.com/ (computed)                                                                                                      
Keypair Path: C:\Users\Ali Berkin\Documents\Solana\test.json                                                                                                      
Commitment: confirmed

Finally, when I tried to check my balance, it threw an error which looks like this

C:\Users\Ali Berkin>solana balance
Error: Dynamic program error: No default signer found, run "solana-keygen new -o 
C:\Users\Ali Berkin\Documents\Solana\test.json" to create a new one

I already created a keypair at C:\Users\Ali Berkin\Documents\Solana\test.json but error tells me to create one. Can someone help me with this?

Edit: I'm sure that test json is at the right directory

C:\Users\Ali Berkin\Documents\Solana>dir                                                                                 
Volume in drive C has no label.                                                                                         
Volume Serial Number is 229F-F657                                                                                                                                                                                                               
Directory of C:\Users\Ali Berkin\Documents\Solana                                                                                                                                                                                              
30.07.2022  15:48    <DIR>          .                                                                                   
30.07.2022  15:48    <DIR>          ..                                                                                  
30.07.2022  15:35    <DIR>          airdrop_project                                                                     
30.07.2022  15:48               231 test.json
6
  • Out of curiosity, could you try doing an airdrop. solana airdrop 1 -- what happens?
    – C.OG
    Commented Aug 1, 2022 at 12:40
  • I got the same error: Dynamic program error: No default signer found
    – brknarsy
    Commented Aug 1, 2022 at 12:42
  • Hmm can you confirm that the file actually exists at C:\Users\Ali Berkin\Documents\Solana\test.json
    – C.OG
    Commented Aug 1, 2022 at 12:56
  • 2
    Another thought is, could be due to the space in your username. Could you create a new keypair to the default path, and try the commands again.
    – C.OG
    Commented Aug 1, 2022 at 13:00
  • yes sir, I edited the question you can check
    – brknarsy
    Commented Aug 1, 2022 at 13:01

2 Answers 2

4

This is due to the space in your username.

Consider choosing a path with no space or use the default path for the keypair file.

0
1

Another possible cause of this problem is using the Unix tilde ~ character in your config file..

Solana CLI does not handle the tilde character properly.

My own system was in a loop of:

% solana config get
Config File: /Users/me/.config/solana/cli/config.yml
RPC URL: https://api.devnet.solana.com
WebSocket URL: wss://api.devnet.solana.com/ (computed)
Keypair Path: ~/.config/solana/id.json
Commitment: confirmed

When I ran commands like:

% solana airdrop 1
Error: Dynamic program error: No default signer found, run "solana-keygen new -o ~/.config/solana/id.json" to create a new one

~/.config/solana/id.json already exists, and the contents look good.

Changing /Users/me/.config/solana/cli/config.yml to use the full path (either by editing the file or with solana config set -k ~/.config/solana/id.json, which will expand into the full path from the shell) fixes the problem.

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.