Closed graebeerd closed 10 months ago
I can prove this, last 0.21.2 version on Windows 11 uses %APPDATA%\Roaming\Pocketcoin\
directory as default.
\
\
@graebeerd thanks for catching this!
Btw, %APPDATA%
is literally pointing to C:\Users\USERNAME\AppData\Roaming\
. (https://superuser.com/questions/632891/what-is-appdata). So the documentation is technically correct, sorry for messing up
(Tested with V21.2 of the windows node) Under windows 10 (and as far as I know earlier versions). The registry key that holds the default data directory is:
HKEY_CURRENT_USER\SOFTWARE\Pocketcoin\Pocketcoin-Qt\strDataDir
open powershell and run this: get-itempropertyvalue -Path 'HKCU:\SOFTWARE\Pocketcoin\Pocketcoin-Qt\' -Name strDataDir
Or open CMD.exe and run this: reg query HKEY_CURRENT_USER\SOFTWARE\Pocketcoin\Pocketcoin-Qt\ /v strDataDir
The powershell method is better as it can put the result into a variable easily.
Either will spit out the current default directory.
Here is a two line power shell script to print it in windows:
$pdata=get-itempropertyvalue -Path 'HKCU:\SOFTWARE\Pocketcoin\Pocketcoin-Qt\' -Name strDataDir echo "The default Pocketnet Data Directory is: $pdata"
Here is a single line CMD.exe or powershell command using the reg.exe on windows 10 to set a new directory:
reg add "HKEY_CURRENT_USER\SOFTWARE\Pocketcoin\Pocketcoin-Qt\" /v strDataDir /t REG_SZ /d "d:\crypto\Pocketnet\Data"
The above command sets the strDataDir to point to "d:\crypto\pocketnet\data". Change that to whatever you want.
So if you want you could make a script to do your stuff fairly easy in powershell or just type in the commands manually. Example powershell:
$pdata=get-itempropertyvalue -Path 'HKCU:\SOFTWARE\Pocketcoin\Pocketcoin-Qt\' -Name strDataDir cd $pdata
FYI to find out the system defaults of the data dir etc I had to check src/util/system.cpp:
fs::path GetDefaultDataDir() { // Windows: C:\Users\Username\AppData\Roaming\Pocketcoin // macOS: ~/Library/Application Support/Pocketcoin // Unix-like: ~/.pocketcoin
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "Pocketcoin";
fs::path pathRet;
char* pszHome = getenv("HOME");
if (pszHome == nullptr || strlen(pszHome) == 0)
pathRet = fs::path("/");
else
pathRet = fs::path(pszHome);
// macOS
return pathRet / "Library/Application Support/Pocketcoin";
// Unix-like
return pathRet / ".pocketcoin";
}
In the documentation for extracting a snapshot to its directory you show:
and it should be