-
Notifications
You must be signed in to change notification settings - Fork 178
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
Move all user data to home directory #475
Conversation
Note: |
It would be useful to have a command line argument |
Maybe just a preference and not important, but why |
Yeah I think lower case is better. Will change.
Makes sense. Will do. |
Pushed a big change with a lot of edits; mainly this comes out of wanting to add the homedir option, then realising it relates back to #430 i.e. I don't want to add a bunch of repeats. So added So this addresses the homedir issue (including for tests as well) - the default is ~/.joinmarket (no longer JoinMarket), but a user can specify |
Passing tests locally so seems there is some travis misbehaviour (see https://travis-ci.org/JoinMarket-Org/joinmarket-clientserver/jobs/628110243#L16377). Not that it really matters of course. This still requires quite a bit of testing and review. |
Oh - mustn't forget to add changes to docs along with this PR. |
Sorry for jumping in, long time lurker, first time commenting, but since it defaults to ~/.joinmarket and not "~/" wouldn't it make more sense to call the parameter datadir instead of homedir? Thanks and congrats to everybody on the great tool. |
Yes. I was thinking that in an idle moment, except I was thinking perhaps appdir or appdatadir ... to be fair, it includes configuration as well as logs and wallets .. not entirely clear what you call that. Does everyone prefer |
They also fail on my computer the same way. |
They fail because of missing |
I see, thanks for spotting that. I misinterpreted the error message in travis and, as you say, inadvertently tested with a valid regtest joinmarket.cfg in the homedir ( or datadir!). Will fix shortly with some kind of startup setting of jm_single().homedir in the test setup phase. |
So 8e0d05b as per the commit comment solves the test config location problem with a wrapper function; instead of calling A small point but the location of the function |
Will do some testing from here, I think the code is done. |
Spent some time looking at how other wallets handle this. I think it's important to think carefully about the end result as this is something that will be P.I.T.A. to change again later. First thing is the directory structure itself. A lot of wallets separate mainnet, testnet and regtest with a subdirectories. It makes sense as you will not use mainnet wallet on a testnet and vice versa. And probably having logs, etc... separate also is good idea. Here's some existing examples of the structure (not complete, only stuff that's relevant):
It looks like it acts the same way as JM currently, you can actually load mainnet wallet in a testnet, no separate subdirectories, etc... I personally would like for JM something like Bitcoin Core does with global config file, but either all other stuff for non-mainnet going into separate subdirectories or even mainnet having separate subdirectory for everything except About homedir vs datadir - datadir is probably better, Bitcoin Core also calls it that way. |
Noticed two issues with the GUI:
|
Yes there seems little disagreement on it. Will change.
I did think about this a little when doing the update to the testing suite. I considered one option being a An interesting question is whether it's actually OK to not use different directories. Wallet .jmdat files encode their network type within them, so there's no danger of confusion there. For commitment related data (commitmentlist and stuff in cmtdata/ and a few special files (example: TUMBLE.schedule, perhaps others), however, I think it would be cleaner to have completely separate directories, even if I don't think anything disastrous is going to happen without that (maybe with external commitments? I'd have to check; also don't think anyone is using them!).
Thanks for getting on with testing already :) I'll address those two points. |
Rebased on master. Addressed the errors in the Qt wallet load as pointed out by @kristapsk ; changed the name from homedir to datadir; updated the usage guide documentation. Any more tests would be welcome. Basically any scripts or Qt functions. |
So to expand on the previous comment about whether using one directory is OK, and whether commitments data is an exception to that rule:
I believe the above justifies the one very small change as in 71b8ed4 and that from here we can happily just use one directory instead of several subdirectories. A reminder: wallets define the network they apply to when created, they cannot be changed after, so no possible confusion there. I have tested transactions on regtest and mainnet and sanity checked that this functions as intended (including using |
This *should* quit with an error, because the connection to Bitcoin Core is not configured; we'll cover that in the next section. | ||
However, this first run will have automatically created a data directory. | ||
Locate the newly created file `joinmarket.cfg` which will be in your user home directory under `.joinmarket/`. | ||
So on Linux you should find it under `/home/username/.joinmarket/joinmarket.cfg`, and similarly for MacOS and Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it /Users/username/Library/Application support/joinmarket/
on macOS, so kinda different and worth mentioning? But somebody more experienced with mac's could comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I didn't mention it because I wasn't exactly sure the right string; "similarly" is sufficiently vague to cover that :) I'll leave it like this until someone confirms the exactly right version.
Have been using this live for a while now. Intend to merge it shortly if no objections. |
I will do some testing of this today or tomorrow, as I haven't after my last comment of Qt GUI issues (which should be fixed now). |
Did some more tests and things look good with wallet-tool.py and joinmarket-qt.py (although that hanged up for me once with no meaningful console output after opening wallet, but not sure that's related), but yield generators now want full path as a wallet file argument instead of just wallet filename as before. |
oh? not for me, but i am using default location for wallets. Are you seeing that problem with |
@kristapsk i can't replicate that problem, I must have missed a certain way to do it? When I do Same if I use |
@AdamISZ Couldn't it be that you have wallet files both in |
Yes, I thought of that and deleted it temporarily and tried again, it made no difference. |
This is output for me:
|
Thanks, all clear now. |
Did some more testing with 47f6200, didn't notice any new bugs, apart from the functionality I didn't test before, it's "Wallet > Export keys" in GUI. Resulting joinmarket-private-keys.json file is saved in a scripts directory, but maybe also should go to datadir? But probably needs to be changed that user can choose file name and destination anyway. |
Thanks. I always forget to test the privkey export, yes I agree, in datadir for now and later make it choosable. Will commit this but then squash and merge. |
To facilitate easier management by users and to follow generally accepted standards, this PR moves the following all to user home directory, subdir .joinmarket : joinmarket.cfg file wallets/ directory logs/ directory cmtdata/ directory commitmentlist file User can override location with --datadir option. An info message is added on startup showing location.
8c8e6e2 Move all user data to home directory (Adam Gibson)
…er scripts 25b2e8e Don't create logs, wallets and cmtdata subdirectories under scripts (Kristaps Kaupe) Pull request description: Leftover from #475. These empty directories may confuse users. Top commit has no ACKs. Tree-SHA512: fafe30639a4b14a95b15bf947011ca6b8ca54a69576e133efc51dbcb530abfabd9df4affc081eda196954e331a337f263444d858474df3153775920c33873eb2
To facilitate easier management by users and to
follow generally accepted standards, this PR moves
the following all to user home directory, subdir
.JoinMarket :
joinmarket.cfg file
wallets/ directory
logs/ directory
cmtdata/ directory
commitmentlist file
An info message is added on startup showing location.