Solana Set Keypair Command Won't write file

Terminal Output:

Genesiss-MBP:metaplex genesisbarrios$ sudo solana config set --keypair ~/.config/solana/devnet-test.json
Password:
Config File: /Users/genesisbarrios/.config/solana/cli/config.yml
RPC URL: https://api.devnet.solana.com
WebSocket URL: wss://api.devnet.solana.com/ (computed)
Keypair Path: /Users/genesisbarrios/.config/solana/devnet-test.json
Commitment: confirmed

Genesiss-MBP:metaplex genesisbarrios$ ts-node js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/.config/solana/devnet-test.json
Beginning the upload for 10 (png+json) pairs
started at: 1637040356704
Error: ENOENT: no such file or directory, open ‘/Users/genesisbarrios/.config/solana/devnet-test.json’
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Object.loadWalletKey (/Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/helpers/accounts.ts:438:34)
at Object. (/Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/commands/upload.ts:66:25)
at step (/Users/genesisbarrios/DesktopProject/metaplex/js/packages/cli/src/commands/upload.ts:44:23)
at Object.next (/Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/commands/upload.ts:25:53)
at /Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/commands/upload.ts:19:71
at new Promise ()
at __awaiter (/Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/commands/upload.ts:15:12)
at Object.upload (/Users/genesisbarrios/Desktop/Project/metaplex/js/packages/cli/src/commands/upload.ts:68:12) {
errno: -2,
syscall: ‘open’,
code: ‘ENOENT’,
path: ‘/Users/genesisbarrios/.config/solana/devnet-test.json’
}

Hi @gendev and welcome to the forum!

I think your problem is that solana config isn’t supposed to create the keypair. It just sets which keypair to use.

To create the keypair try running solana-keygen new -o ~/.config/solana/devnet-test.json and that will create the keypair for you.

1 Like