Skip to content
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

SDK-166 - add custom storage names parameter to DbTool #435

Closed
wants to merge 3 commits into from

Conversation

davehorizen
Copy link
Contributor

In this pull request:

  • added custom storage names parameter to DbTool
  • python test sc_storage_recovery_with_csw updated with SimpleApp custom storage names

@davehorizen davehorizen linked an issue Jul 4, 2022 that may be closed by this pull request
@davehorizen davehorizen requested a review from alsala July 5, 2022 08:22
Copy link
Collaborator

@paolocappelletti paolocappelletti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are assuming that we have always custom storages, but that may not happen.
Since we have already some optional parameters I think we have to switch from "positional" parameters to something identified by a param name:
like:
< program name> [ -s=< storages data dir path > ] [ -n=< custom storage names > ] [ -f=< path to json file > ] < command name > [< json data >]

Please also update the printed hellp:
https://github.com/HorizenOfficial/Sidechains-SDK/blob/db/SDK-166/tools/dbtool/src/main/java/com/horizen/DbToolCommandProcessor.java#L107

@davehorizen
Copy link
Contributor Author

You are assuming that we have always custom storages, but that may not happen. Since we have already some optional parameters I think we have to switch from "positional" parameters to something identified by a param name: like: < program name> [ -s=< storages data dir path > ] [ -n=< custom storage names > ] [ -f=< path to json file > ] < command name > [< json data >]

Please also update the printed hellp: https://github.com/HorizenOfficial/Sidechains-SDK/blob/db/SDK-166/tools/dbtool/src/main/java/com/horizen/DbToolCommandProcessor.java#L107

Right now the DB tool is only used in the python tests and not by end users. Moreover, changes in the DB tool interface will introduce a difference with the Bootstrapping tools (of the same package) that still reads the parameters in a positional manner.
The interface changes is a great idea but it is better to take care of it in a separate task that change the DB and Bootstrapping tools interface.

With the last commit I updated the printed helper and the python test sc_storage_recovery_without_csw

@i-Alex i-Alex self-requested a review July 14, 2022 08:07
Copy link
Contributor

@i-Alex i-Alex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works.

In general I'm thinking why do we need at all the checks against the storageNames set in the DB pool. Instead we can set the only argument - full path to the storage, then inside we will check if the file exists and will try to open this level db based storage.
@alsala what do you think?

@i-Alex
Copy link
Contributor

i-Alex commented Aug 22, 2022

Replaced by #509
Merged as a part of 0.4.1

@i-Alex i-Alex closed this Aug 22, 2022
@i-Alex i-Alex deleted the db/SDK-166 branch February 16, 2023 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom local storages to sdk dbtool
4 participants