Solana Can't find devnet.json

Viewed 608

I'm following this article as a practice. And stuck with

cat .config/solana/devnet.json

I realize that windows OS doesn't have cat so I tried

type ~/.config/solana/devnet.json

that result in

The syntax of the command is incorrect.

so I try again with

type "~/.config/solana/devnet.json"

and this time, it leads to

The system cannot find the file specified.

It's kind of surprise me so I browse that directory(C:\Users\my-name\.config\solana) and found devnet.json is truly not there.

My questions are where could this file be? Or which step I might do wrong so the file was not generated? I check the result message of each step, things look fine...

4 Answers

It turns out since I didn't change the working directory so the devnet.json is saved in C:\Windows\System32\~\.config\solana

Got the same problem It seems that there is no devnet.json file created but the devnet wallet works successfully

you may download git bash on your windows machine and can simply use cat and all bash commands after?

You're following Linux instructions which are not 100% compatible with your Windows OS. ~ is alias for home directory in Linux and it doesn't work in Windows where ~ is a normal char. That led to you the initial confusion. Also other differences like type / cat. On Windows use full path to your home directory (usually something like C:\Users..., etc.). So your key-gen command can look like something like this

solana-keygen new --outfile C:/Users/hsiao/keys/devnet.json

Then you can use

solana config --keypair C:/Users/hsiao/keys/devnet.json

and be happy ever after!

Related