Fix for many wallet config errors#731
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
|
I have been thinking, perhaps this pull might need a bit of reworking/discussing @yeastplume.
Let me know what you think. |
|
I can't compile with this PR: |
|
@aglkm That can very well be the case, I reverted some code, sloppy that I pulled that to main. |
… before pulling to main
…fig template in working dir
|
The pull is ready for review. Tested and works for: |
|
Changes look okay so far, but there are still quite a few test failures, see log from runs above |
|
I will have a look at it. I did not yet read the Rust Book chapter on tests, so I simply forgot to run cargo test and adjust existing tests. I expect it to be little work. |
|
@yeastplume Works now, at least on Windows 11. |
|
I ran into the following issues on my Linux machine. 1.In my 2.
3.I'm not sure about changing to relative paths. What about API or 3rd party software relying on the |
|
Tests passing, looks good. @aglkm if you have time, can you see if those issues are still occurring in master and create a separate issue for them to keep them straight. |
|
This PR was not ready for merging. |
I'm usually okay with a bit of instability on master when it's just around the fringes of config, but in this case I think you're right and I was a bit too hasty merging. Going to revert and consider a few things here more carefully. |
This reverts commit 7ceade4.
This reverts commit 7ceade4.
This reverts commit 7ceade4.
|
@aglkm #2 #3 I see I need to do more fixing and testing, I will let you know when you can give it another test @aglkm |
|
Issue There's more to add to issue I do see the changes related to absolute vs relative paths (issue After: |
|
@aglkm I also noticed the replacement not working. I must have reverted something at some point or the change were only locally, I would have sworn it worked at some point. I do make the replacement in the code but it does not work for some reason, probably because it contains escape characters. In any case thank you for taking the time to do testing, it is appreciated. |
|
I am going to take more time for this pull request. I have two versions with different dependency versions giving different results ( one with bug 1 fixed and 3 not working and the other exactly the other way) while having the same code. Also one of them cannot make push request to github anymore. |
Previous behavior:
wallet.rs creates config with updated .api_secret .foreign_api_secret and .owner_api_secret
wallet arguments
-h (here)ad-t (top_dir)updated the paths in the config, including .api_secret which was wrongly set to top_dir or in case of -h to current directory. Secondly, later on grin_wallet_controller::command::init is called , even though the config file is passed via args, a new config file is created.New behavior
All wallet config creation happens purely in wallet.rs using functions defined in config.rs.
The node path is determined flexibly, first checking top_dir if .api_secret exist there, otherwise assuming home/.grin
Paths set by top_dir are relative and not absolute. Meaning the user can move around the folders that contains grin, grin-wallet and its data as long as grin binary does not move relative to the grin-wallet data dir. An alternative would be to make the path absolute.
Issues that are fixed (or related). Quite a few issue can be closed.
#478 [related, not fixed]
#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.