@@ -25,9 +25,8 @@ import (
2525)
2626
2727var (
28- startBin string
29- startNoPrompt bool
30- startNoCosmovisor bool
28+ startBin string
29+ startNoPrompt bool
3130)
3231
3332var startCmd = & cobra.Command {
@@ -102,22 +101,15 @@ var startCmd = &cobra.Command{
102101 }
103102 }
104103
105- // Determine which supervisor to use (Cosmovisor or direct pchaind)
106- var sup process.Supervisor
107- useCosmovisor := false
108-
109- if ! startNoCosmovisor {
110- detection := cosmovisor .Detect (cfg .HomeDir )
111- if detection .Available {
112- useCosmovisor = true
113- if flagOutput != "json" && ! detection .SetupComplete {
114- p .Info ("Initializing Cosmovisor..." )
115- }
116- }
117- sup = newSupervisor (cfg .HomeDir )
118- } else {
119- sup = process .New (cfg .HomeDir )
104+ // Verify cosmovisor is available
105+ detection := cosmovisor .Detect (cfg .HomeDir )
106+ if ! detection .Available {
107+ return fmt .Errorf ("cosmovisor binary not found; install it or ensure it's in PATH" )
108+ }
109+ if flagOutput != "json" && ! detection .SetupComplete {
110+ p .Info ("Initializing Cosmovisor..." )
120111 }
112+ sup := newSupervisor (cfg .HomeDir )
121113
122114 // Check if node is already running
123115 isAlreadyRunning := sup .IsRunning ()
@@ -130,11 +122,7 @@ var startCmd = &cobra.Command{
130122 p .Success ("Node is running" )
131123 }
132124 } else {
133- if useCosmovisor {
134- fmt .Println ("→ Starting node with Cosmovisor..." )
135- } else {
136- fmt .Println ("→ Starting node..." )
137- }
125+ fmt .Println ("→ Starting node with Cosmovisor..." )
138126 }
139127 }
140128
@@ -160,14 +148,10 @@ var startCmd = &cobra.Command{
160148 return err
161149 }
162150 if flagOutput == "json" {
163- p .JSON (map [string ]any {"ok" : true , "action" : "start" , "already_running" : isAlreadyRunning , "cosmovisor" : useCosmovisor })
151+ p .JSON (map [string ]any {"ok" : true , "action" : "start" , "already_running" : isAlreadyRunning , "cosmovisor" : true })
164152 } else {
165153 if ! isAlreadyRunning {
166- if useCosmovisor {
167- p .Success ("Node started with Cosmovisor" )
168- } else {
169- p .Success ("Node started successfully" )
170- }
154+ p .Success ("Node started with Cosmovisor" )
171155 }
172156
173157 // Check validator status and show appropriate next steps (skip if --no-prompt)
@@ -186,7 +170,6 @@ var startCmd = &cobra.Command{
186170func init () {
187171 startCmd .Flags ().StringVar (& startBin , "bin" , "" , "Path to pchaind binary" )
188172 startCmd .Flags ().BoolVar (& startNoPrompt , "no-prompt" , false , "Skip post-start prompts (for use in scripts)" )
189- startCmd .Flags ().BoolVar (& startNoCosmovisor , "no-cosmovisor" , false , "Use direct pchaind instead of Cosmovisor" )
190173 rootCmd .AddCommand (startCmd )
191174}
192175
0 commit comments