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

improves output of stop command #3641

Merged
merged 1 commit into from
Mar 11, 2023
Merged

improves output of stop command #3641

merged 1 commit into from
Mar 11, 2023

Conversation

hughy
Copy link
Contributor

@hughy hughy commented Mar 11, 2023

Summary

the 'stopNode' RPC shuts down the node before returning a response, so the cli client receives an error from the lost connection. IronfishCommand handles RPC connection errors and outputs 'Cannot connect to your node, start your node first.'. this is confusing both because we were able to connect to the node and because we successfully stopped it.

the stop command also silences RPC connection errors, so nothing is output if the node is already stopped when stop is run.

  • returns a response from stopNode before shutting down the node
  • removes error handling from 'client.connect' in stop command since the IronfishCommand abstract class handles these errors
  • adds output to 'stop' command indicating that it asks the node to shut down

Testing Plan

manual testing:

  • start a node
  • use 'ironfish stop' to stop the node
  • use 'ironfish stop' to try to stop the node again once it has shut down

Before:
image

After:
image

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

the 'stopNode' RPC shuts down the node before returning a response, so the cli
client receives an error from the lost connection. IronfishCommand handles RPC
connection errors and outputs 'Cannot connect to your node, start your node
first.'. this is confusing both because we were able to connect to the node and
because we successfully stopped it.

the stop command also silences RPC connection errors, so nothing is output if
the node is already stopped when stop is run.

- returns a response from stopNode before shutting down the node
- removes error handling from 'client.connect' in stop command since the
  IronfishCommand abstract class handles these errors
- adds output to 'stop' command indicating that it asks the node to shut down
@hughy hughy requested a review from a team as a code owner March 11, 2023 01:35
Copy link
Member

@dguenther dguenther left a comment

Choose a reason for hiding this comment

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

Tested running it against a started node and a stopped node, looks good!

@dguenther dguenther merged commit 7090e73 into staging Mar 11, 2023
@dguenther dguenther deleted the fix/stop-node branch March 11, 2023 05:13
@hughy hughy mentioned this pull request Apr 19, 2023
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.

2 participants