-
Notifications
You must be signed in to change notification settings - Fork 137
WP: Fix for many wallet config errors including solution for -h and -t wrongly setting the node path #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…n progress on changing default dir for node api ssecret 'foreign_api_secret'
… config made earlier, its never written to a file when running init
…-compiling but some warnings
…Pull 3420, partial fix for 3002
… before pulling to main
…fig template in working dir
…rin-wallet.rs -> config::initial_setup_wallet, requires more testing!
… grin-wallet code, test on Linux if it works
…nal grin-wallet code, probably by an inherent bug in fs::create_dir_all
…fs crate, to make it support backslashess in top_dir path
…at the path in the seed generation message
…e last tests on Linux
…e in all warning messages
Update Possible things to improve
@aglkm If you have time, can you give it another test? |
Issues reported here: #731 (comment) Steps to re-create:
So the wallet is ignoring the "top-dir" directory (/home/user/grin/grin-wallet-sources/grin-wallet-pr732/grin-wallet/top-dir) and still is trying to use the default one. In grin-wallet.toml file the path is correct:
Another issue:
|
@aglkm Thanks for explaining issue 1, I misunderstood you before. Basically grin-wallet will always assume that if you do not provide the '-t' top-dir command that it should use the wallet in the default directory. What you are proposing is a smart auto-detect wallet_data directory function.
This is actually desired behavior. What I mean is that all paths you provide to grin-wallet should be given relative to your current working directory, not relatively to the executable. For example, if you are in the top_dir, you would have to run
I could change this behavior, but I think it is customary for executable to use paths relative to the current working directory and not paths relative to the directory of the executable. Therefore I would propose not to change this behavior and keep it as is. What do you think @yeastplume? |
It is documented in grin-wallet docs that the wallet will check the current directory first and then the
This is how it works currently. What is this PR proposing: if you wish to use local (non default) config files, you have to explicitly specifying current working directory every time you execute a wallet, while you are already locating there. I disagree with this.
Here ☝️ I've specified the path to grin-wallet executable relatively to the current working directory and provided the path to "top-dir" relatively to the current working directory as well, not an executable. The current wallet behaviour has no such issue. You wrote:
Wallet shouldn't try to think instead of a user, because a desired behaviour could be different. I could want a fresh config file, but instead wallet will create it from an old "template" - a config file which is placed in the current directory. It's more straightforward to let user to copy the old config file if he wishes to preserve the settings. You wrote:
The difference between a template file and a config file: a config file becoming a template file if the user is trying to create a new wallet while also the config file exists in the current directory. If we want to have "template" files it could be better to introduce a new option, so the user can directly specify what he wants to do and do not let the wallet to decide. As a user, it could be confusing, that the wallet is silently trying to use a config file as a template file. There's another thing that need attention. When you are creating a config file from a "template" it will create a relative path in grin-wallet.toml file, like that:
What's the purpose of this change? This could potentially break the things, e.g. API. |
Interesting, this functionality is not present in the code. It does make sense to add it since many users might expect the wallet to be smart enough to detect it. I will add it to the code, it is similar smart behavior as I have implemented for detecting the path to the node.
This sounds very contradicting when you are saying that you want smart behavior for the wallet to detect the path to the node and smart behavior to detect if a local wallet folder is present, yet you do not want smart behavior? The whole point of this pull request is to fix Smart behavior:
Using a config in the executable dir with -init as template is an extension of the behavior that when running without -init the config file will indicate which wallet to open and with what settings. Again, this is not me making real change, just extending on existing behavior. To give you an example, lets say you copy grin-wallet.ex inside the 'wallet_data' directory, it will exactly perform the smart behavior you are asking for, it will detect the config and as such load the wallet in which data directory the executable resides. So this is in fact the described behavior you are asking for.
More importantly, lets make grin-wallet user friendly for those 99% of user that expect the grin-wallet to emulated some minimal level of intelligence. And also lets not forget that the current situation is that |
…ing config in current dir
#478 [Partly Fixed/answered, cannot be solved easily since generate by toml crate ]
#728 [fixed]
mimblewimble/grin#3803 [fixed]
mimblewimble/grin#3394 [fixed]
mimblewimble/grin#3420 [Abandoned Pull request, my pull replace this one]
mimblewimble/grin#3002 [Partly fixed, not default values part]
mimblewimble/grin#2300 [Could be closed, not dependent on my pull]
Note
The wallet firsts checks a) current directory for config, b) top_dir for config, then c) assumes its in home/.grin.
Option a) suppresses generation of a config file when running grin-wallet.exe init, not sure if that is intentional behavior or that the config should be crated but the one in current dir should be loaded.