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

feat: interactive command-line for running node #136

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

darshankabariya
Copy link

@darshankabariya darshankabariya commented Nov 12, 2024

Overview

This PR introduces interactive command-line interface designed to simplify waku node operations. The script provides a user-friendly menu-driven approach, eliminating the need for operators to memorize commands or frequently refer to documentation.

I'm trying to make running a node a bit more convenient for new operators comming to waku.

Key Features

  • Quick Start ( Setup & Run Node )
  • Node Management ( start, stop, restart & etc )
  • Monitoring & Logs
  • Maintenance of node
  • Infura setup with proper guidlines
  • Update your node according to new release
  • Backup and restore functionality for environment variable
  • Help & Documentation

Inspiration

  • Our current process isn't overly complex, but it is manual-intensive. Operators frequently need to refer to the README file for basic operations.
  • While documentation is comprehensive, constantly switching between documentation and terminal can be cumbersome.
  • Every node operator is valuable to our network, and we should strive to make their experience as smooth as possible.
  • Codex node - console

Note

The current process works as it is; this is simply an interface built on top of the manual process.

@gabrielmer
Copy link
Contributor

Looks amazing! Maybe we should update the README to indicate how to use the CLI? Will also help to try it out myself

@darshankabariya
Copy link
Author

darshankabariya commented Nov 13, 2024

Looks amazing! Maybe we should update the README to indicate how to use the CLI? Will also help to try it out myself

Thanks !
Of course, that's definitely required! I've just updated the README file. Please give it a try and let me know if you find any bugs or have suggestions—I'm happy to make improvements.

@darshankabariya darshankabariya self-assigned this Nov 17, 2024
Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

Can't wait to see! I will try it out as part of my review!
But awesome initiative, huge thanks!

echo -e "\n${GREEN}${BOLD}✨ Your Waku node is ready!${NC}"
echo -e "📊 View metrics: http://localhost:3000"
echo -e "💬 Chat interface: http://localhost:4000"
echo -e "🔍 Check node health: ./waku-cli.sh status"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
echo -e "🔍 Check node health: ./waku-cli.sh status"
echo -e "🔍 Check node health: ./interactive-cli.sh status"

Copy link
Author

Choose a reason for hiding this comment

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

My pleasure! Please mention any other bugs or improvements—I’m happy to work on them!

@Ivansete-status
Copy link
Contributor

I like it a lot. Thanks so much indeed 🙌 !
We need to review all the menu options and make sure everything works well.
For example, I'm trying to register a membership with an existing .env file but this seems not to be covered. Then, when I answer y to the following question, I was expecting the register_rln.sh to be called and then, start the node but it seems the node is started right away without calling register_rln.sh.

image

@darshankabariya
Copy link
Author

darshankabariya commented Nov 20, 2024

Then, when I answer y to the following question, I was expecting the register_rln.sh to be called and then, start the node but it seems the node is started right away without calling register_rln.sh.

my understanding for re-registration of RLN is only required if there are changes made to the .env file. Otherwise, the existing keystore should work as expected. So, if the user doesn’t modify the .env configuration, the older keystore remains valid. If someone edits the .env file for the first time or updates existing credentials, keystore generation will definitely be required as part of the process.

However, I’ve internally hidden the registration process to simplify things. but yeah, explicitly showing the need to generate a new keystore would make the process more transparent and informative for users.

@gabrielmer
Copy link
Contributor

The UI looks suuuuper cool!

There might be some error handling missing. For example, in my case that docker-compose doesn't work and the newer docker compose is installed in my machine, the node doesn't start but it shows as everything worked fine.

Apart from showing whenever there's an error, we should also check if the dependencies are installed and if something is missing show an error message.
Ideally, we should be able to differentiate and handle different docker compose versions and use docker-compose or docker compose depending on the version, but the most important thing is to properly show an error if something goes wrong.

image

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.

4 participants