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

Add node watcher to testnet scripts #2261

Merged
merged 3 commits into from
Sep 1, 2020
Merged

Conversation

camilbancioiu
Copy link
Contributor

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.

@iulianpascalau iulianpascalau self-requested a review August 31, 2020 13:15
iterateOverValidators stopSingleValidator
}

iterateOverValidators() {
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

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

Copy link
Contributor Author

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() {
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

@sasurobert sasurobert left a comment

Choose a reason for hiding this comment

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

remove duplicated code

@AdoAdoAdo AdoAdoAdo merged commit 573c703 into development Sep 1, 2020
@AdoAdoAdo AdoAdoAdo deleted the watcher-and-refactor branch September 1, 2020 08:10
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.

None yet

4 participants