-
Notifications
You must be signed in to change notification settings - Fork 211
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
Better structure for the internal organization of our state directory #566
Conversation
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.
lgtm 👍
(but tests need to be adjusted)
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.
I like that parent directories are created and there are by default separate state directories for each network of each backend.
But nesting 2 levels of subdirectories within the state dir will make deployment less convenient. We are also committing the same error as http-bridge does -- see how that causes an unnecessary nesting of directories.
I think we should change it to stateDirOption :: Parser (Maybe FilePath)
. Adjust the help string to say the default is $HOME/.cardano-wallet/BACKEND/$network
. Then fill in the default value if the option was Nothing.
d5a14e1
to
df534c3
Compare
Meanwhile, I've adjusted the tests and added tests for nested dir state-dir. |
Such that our state dir looks nicer: /home/ktorz/.cardano-wallet/ └── jormungandr └── testnet ├── chain │ ├── blocks.sqlite │ ├── blocks.sqlite-shm │ └── blocks.sqlite-wal ├── jormungandr-config.json ├── wallet.db ├── wallet.db-shm └── wallet.db-wal
df534c3
to
4c18851
Compare
- Put the default --state-dir within the XDG data dir - Make --state-dir point to the actual state dir, rather than nesting directories within.
4c18851
to
ceaf74c
Compare
We do use 'mempty' often to align text and ease readability. So the small overhead is acceptable and, most probably removed by GHC at compile-time...
Issue Number
#564
Overview
--state-dir
wouldn't be created and fail in a not-so-user-friendly way:Comments