diff --git a/Makefile b/Makefile index 6811b76..b4a8f73 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ run: ./interactive-cli.sh +status: + ./interactive-cli.sh status \ No newline at end of file diff --git a/interactive-cli.sh b/interactive-cli.sh index 2e4d962..c95a717 100755 --- a/interactive-cli.sh +++ b/interactive-cli.sh @@ -22,19 +22,15 @@ print_banner() { echo } -# Show spinner while running command -spinner() { - local pid=$1 - local delay=0.1 - local spinstr='|/-\' - while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do - local temp=${spinstr#?} - printf " [%c] " "$spinstr" - local spinstr=$temp${spinstr%"$temp"} - sleep $delay - printf "\b\b\b\b\b\b" - done - printf " \b\b\b\b" +start_node() { + # Start the node + echo -e "\nšŸš€ Starting Waku node..." + docker-compose up -d & + + 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: make status" } # Function to handle Sepolia RPC setup @@ -101,14 +97,12 @@ setup() { echo -e "${YELLOW}Keeping existing configuration${NC}" read -p $'\n'"Ready to start the node? (Y/n): " start_confirm if [[ $start_confirm != [nN] ]]; then - docker-compose up -d + start_node fi return fi - fi - - # Copy .env.example to .env if it doesn't exist - if [ ! -f .env ]; then + else + # Copy .env.example to .env if it doesn't exist cp .env.example .env if [ $? -ne 0 ]; then echo -e "${RED}Error: Could not find .env.example file${NC}" @@ -178,17 +172,9 @@ setup() { # Register RLN membership echo -e "\nšŸ“ Registering RLN membership..." ./register_rln.sh & - spinner $! # Start the node - echo -e "\nšŸš€ Starting Waku node..." - docker-compose up -d & - spinner $! - - 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" + start_node } # Interactive menu function @@ -244,9 +230,7 @@ quick_start_menu() { press_enter ;; 2) - echo -e "\n${BOLD}Starting Waku node...${NC}" - docker-compose up -d - echo -e "\n${GREEN}āœ… Node started successfully!${NC}" + start_node press_enter ;; 3) return ;; @@ -274,8 +258,7 @@ node_management_menu() { case $choice in 1) - echo -e "\n${BOLD}Starting node...${NC}" - docker-compose up -d + start_node press_enter ;; 2)