Closed hvredevoort closed 4 years ago
Please test this thoroughly as it can really mess up your RNode. Also provide an example of the correct --datadir parameter if the cpchain program is in ~/cpchain and datadir is below ~/cpchain
Your report confused me a lot. I called the guy that developed the compact feature, and we reviewed this issue, and currently have no idea why it was that messy and why you had no permission of these subdirectories.
We will try to reproduce your issue, and figure it out.
Ah, I got it. The reason why your subdirectories are messy is that the --datadir
flag is referring to whole cpchain directory which includes keystore
and cpchain
etc. Here I attached the directory structure of my computer.
If --datadir
is not referring the whole cpchain directory (as in my case, the /home/shi/.cpchain), the compact command will create subdirectories like cpchain
and keystore
under it.
I am not sure if I have explained it clearly.
The issue is that it creates directories when it shouldn’t If you try a few variations (because the documentation is unclear), these same empty directories are created in multiple locations.
Ah, I second what you said above. The compact commands is not poka-yoke enough. We may restrict the usage of the command by giving a default value of delete dpor-
flag.
Where does the bug occur? [e.g. the chain, the wallet, the explorer] chain
What is your wallet address and your balance? If it is too private to answer, you can skip it. irrelevant
Describe the bug When the following command is given in this or other variations: ./cpchain chain delete dpor- --datadir ~/.cpchain ./cpchain chain delete dpor- --datadir ~/cpchain ./cpchain chain delete dpor- --datadir /home/username/cpchain ./cpchain chain delete dpor- --datadir /home/username/cpchain/datadir ./cpchain chain delete dpor- --datadir /home/username/cpchain/datadir/chaindata
it creates several different directories like cpchain, keystore, chaindata below the ./datadir directory or other directories depending on what parameter is used. If the default is used with ~/.cpchain it also creates these directories below that directory. If you then issue du -h --total it will have no permission to read those directories.
To Reproduce Steps to reproduce the behavior, and the commands you use. Try several parameters for --datadir ./cpchain chain delete dpor- --datadir ~/.cpchain ./cpchain chain delete dpor- --datadir ~/cpchain ./cpchain chain delete dpor- --datadir /home/username/cpchain ./cpchain chain delete dpor- --datadir /home/username/cpchain/datadir ./cpchain chain delete dpor- --datadir /home/username/cpchain/datadir/chaindata
Expected behavior I don't expect directories to be created, this is a bug.
Screenshots If applicable, add screenshots to help explain your problem.
Configuration (please complete the following information):
Additional context Add any other context about the problem here. If your bug can only be reproduced occasionally, please emphasize it.