I am trying to run the suite of Windows executables released as zcash-windows-v5.2.0 - as part of a blockchain class exercise.
Zcashd using the Windows binary is very fast: I did a full sync in less than six hours.
However, when I try to run zcash-cli getinfo, I am getting the following error:
Error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file.
How do I get the Windows binaries to work correctly? Are there step-by-step instructions online that someone can point me to? FYI- I have already tried running the recommended Debian / Ubuntu versions on virtual machines and they always errored out with an âout of memoryâ error, never reaching full sync.
It sounds like you need to enable the rpcuser and cookie authentication or rpcpassword fields in the conf file for remote rpc execution. Ill find the docs but essentially you set these flags in the conf (or in the zcashd start command) and are then required in any subsequent rpc command. Launching rpcs from outside of the zcash/src dir requires setting these fields regardless. Typically users just use rpcpassword for local home-node stuff but the cookie auth method is recommended for applications requiring more security.
Sure is useful to have the option to pass user credentials in as part of the command. I did not know that was even possible. I gave it a shot. Passing in password and user to .\zcashd definitely does not work. That throws this error: âThere is no RPC client functionality in zcashd.â Unfortunately, running .\zcash-cli while passing in the conf filepath, user and password threw the original error message. Could be that the conf file needs to first be set up with user credentials prior to running .\zcashd. Iâll try running .\zcashd -reindex after setting up the conf file, and take it from there. Thanks for the info. Very helpful!
Huh? I thought reindex is quicker. Doesnât restart download all the blocks again from scratch? Asking cause I really donât know. Thanks for your patience. Zcash newbie here.
Restart as in turn the node back on, it doesnt need to reindex every time you stop it. Reindex is an option you call to delete any existing blockchain data and redownload the whole thing. The stop command just stops it.
Those rpcuser and password settings do need to be set before zcashd starts regardless, otherwise it wont know what they are.
Okay, that makes senseâŚI noticed something when I last ran zcashd though. The splash screen said I was running a mainnet zcashd node, even though I had set testnet=1 & addnode=testnet.z.cash in my conf file. That makes me wonder if zcashd is even reading my conf file to begin with. Okay, back to the drawing board. Appreciate the input.
No if thatâs the case then probably not. the default location is inside the zcash folder I believe but, as I do with mine, you can place the conf in a parent directory relative to zcash. In Ubuntu zcashâs house is typically C:/home/username/zcash/src/zcashd and I put my conf in /username/zcash.conf and then to run ./zcash-cli conf=â/home/username/zcash.confâ (rpcuser/passwrd). Like I said I just hast to be in the path to find it, otherwise itâll either not start or call to the default which might be /home/username/zcash/zcash.conf
Good insight. My takeaway is that the conf file needs to be in the path zcashd expects, which should be a parent directory relative to the zcashd executable. The Windows binary zcashd.exe is a portable app, so my thought was that it can live in any directory. I had lazily left it in the Downloads directory, but after considering your comment, I think I need to move and launch it from elsewhereâŚ
With the Windows binary version, Zcashd expects zcash.conf to be in a very specific location: C:\Users\user\AppData\Roaming\Zcash\zcash.conf This is stated explicitly, as initially, there is no zcash.conf file, and the user is prompted to create one in that exact location.
So, in order for zcash.conf to be in the path, I may need to move zcashd.exe to a directory that is a child directory relative to the Zcash directory, i.e., something like C:\Users\user\AppData\Roaming\Zcash\zcashd
With Zecwallet on windows itâs very similar to what your modeling: the data lives in AppData\Roaming folder and the binaries live in AppData\Local\Programs so I would probably place the conf in itâs predetermined location like it suggests. The AppData Folder is typically hidden and youâll need to enable it in the âviewâ tab.
These are the zecwallet docs, theyâre a little old now but still apply and describe the same (or very similar it seems) windows setup Using ZecWallet - ZecWallet Docs