-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Adding debug mode to local node. #465
feat: Adding debug mode to local node. #465
Conversation
16a9079
to
2ccfdf1
Compare
67a7ffa
to
e314d8b
Compare
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.
Nice, just a few nits and we'll be ready to go
local: | ||
deleteAfterProcessing: true |
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.
Remove this, so we get the default from the mirror-node itself. If we need to enable it, will do so when starting the local-node itself and clean it after starting.
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.
This flag needs to be present in the context of the whole debug workflow.
This is the only way, I think, to double check that the Mirror node is started with "deleting of the record files disabled"
If you want to clear this. We need to start a cleanup procedure on localnode stop
Unfortunately we already execute cleanup state on the start
command
SO this means we need to pass the previous step as a parameter of the current. Or something like that...
I think setting this flag on every command is the simplest.
ef7083a
to
d3c6c0a
Compare
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.
few nits
src/state/InitState.ts
Outdated
application.hedera.mirror.importer.downloader['local']['deleteAfterProcessing'] = !debugMode | ||
|
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.
Add this to originalNodeProperties.json
with key debugNodeProperties
and then use it similar to the others.
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.
OK... I did as you asked in the current state of the MR. But I don't get how this solves our problem.
CLIs are not suppose to and can't hold state between command executions.
Because of this, there is no way of knowing (inside the debug command) how was the Local Node started.
And we have a requirement to start it, with the flag we are discussing, set to
false
.
That's why I created this function checkForDebugMode
that checks exactly that. And outputs an error if you try to debug
with local node not in debug mode.
We set the flag on InitState
but we clean it in CleanUpState
The only way of passing state to it is config file. As far as I can see.
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.
Maybe a good solution would be to combine the two commands:
- when we start in debug mode. we would start asking the user for timestamp
- output whatever is in the record file
- prompt again / or exit
That way we would always be in the context of the start (with debug) command. And we will STOP the execution on exit.
Maybe we could use inquirer
or any other lib to achieve that ?
d3c6c0a
to
aa7df82
Compare
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
Signed-off-by: Stefan Stefanov <stefan.stefanooov@gmail.com>
Signed-off-by: Stefan Stefanov <stefan.stefanooov@gmail.com>
Signed-off-by: Stefan Stefanov <stefan.stefanooov@gmail.com>
Signed-off-by: Stefan Stefanov <stefan.stefanooov@gmail.com>
7ea281e
to
5b1b4c6
Compare
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
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.
LG
Description:
run hedera debug with any valid timestmp returns the record file for that timestamp
Related issue(s):
Fix debug mode and add documentation#269