diff --git a/main.go b/main.go index 707190f..15b116f 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "os" "github.com/spacemeshos/smrepl/client" + "github.com/spacemeshos/smrepl/log" "github.com/spacemeshos/smrepl/repl" ) @@ -40,6 +41,15 @@ func main() { } } + // TODO: change this to use the health service when it is ready + _, err = be.GetMeshInfo() + if err != nil { + log.Error("Failed to connect to mesh service at %v: %v", be.ServerInfo(), err) + fmt.Println() + flag.Usage() + os.Exit(1) + } + repl.Start(be) }