-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add node watcher to testnet scripts #2261
Conversation
iterateOverValidators stopSingleValidator | ||
} | ||
|
||
iterateOverValidators() { |
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.
almost duplicate code with iterateOverObservers
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.
+1
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.
can remain as it is
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.
Due to Bash specifics, these two duplicated functions are cleaner than a single deduplicated iterator (at least at my level of knowledge). A future rewrite in Python will allow for cleaner code.
echo "$source_command ; $watcher_command" | ||
} | ||
|
||
assembleCommand_startValidatorNode() { |
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 doesn't actually start the node but assemble the command line for a node
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.
+1
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, the function is called assembleCommand_startValidatorNode()
. Can rename to something else if unclear.
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.
can remain as it is
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 duplicated code
There is now a variable called
NODE_WATCHER
, set by default to 1. This variable enables the so-called node watcher, a daemon which restarts the node if it dies.Enabling the node watcher will also make the node a daemon. This means that it cannot be stopped with CTRL+C from tmux anymore.
A better solution must be implemented. The current node watcher was designed with a different use case in mind, and is somewhat incompatible with the testnet scripts.