From 176d26fd644d75c9a9ce3d733a73784f116fe0b5 Mon Sep 17 00:00:00 2001 From: felipemadero Date: Mon, 16 Dec 2024 13:58:06 -0300 Subject: [PATCH] increase mainnet timeout (#2453) * increase mainnet timeout * create run dir when cli first starts --- cmd/root.go | 7 +++++++ pkg/constants/constants.go | 2 +- pkg/node/local.go | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index a4c04b1f7..c1c25617e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -293,6 +293,13 @@ func setupEnv() (string, error) { return "", err } + // Create run dir if it doesn't exist + runDir := filepath.Join(baseDir, constants.RunDir) + if err = os.MkdirAll(runDir, os.ModePerm); err != nil { + fmt.Printf("failed creating the run dir %s: %s\n", runDir, err) + return "", err + } + // Create custom vm dir if it doesn't exist vmDir := filepath.Join(baseDir, constants.CustomVMDir) if err = os.MkdirAll(vmDir, os.ModePerm); err != nil { diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index bbc78a519..868082034 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -59,7 +59,7 @@ const ( FastGRPCDialTimeout = 100 * time.Millisecond FujiBootstrapTimeout = 15 * time.Minute - MainnetBootstrapTimeout = 4 * time.Hour + MainnetBootstrapTimeout = 24 * time.Hour SSHServerStartTimeout = 1 * time.Minute SSHScriptTimeout = 2 * time.Minute diff --git a/pkg/node/local.go b/pkg/node/local.go index 5da546327..ac6f0edc4 100644 --- a/pkg/node/local.go +++ b/pkg/node/local.go @@ -283,6 +283,7 @@ func StartLocalNode( nodeConfig = map[string]interface{}{} } nodeConfig[config.NetworkAllowPrivateIPsKey] = true + nodeConfig[config.IndexEnabledKey] = false nodeConfigBytes, err := json.Marshal(nodeConfig) if err != nil { @@ -333,7 +334,7 @@ func StartLocalNode( case network.Kind == models.Fuji: ux.Logger.PrintToUser(logging.Yellow.Wrap("Warning: Fuji Bootstrapping can take several minutes")) case network.Kind == models.Mainnet: - ux.Logger.PrintToUser(logging.Yellow.Wrap("Warning: Mainnet Bootstrapping can take 1-2 hours")) + ux.Logger.PrintToUser(logging.Yellow.Wrap("Warning: Mainnet Bootstrapping can take 6-24 hours")) case network.Kind == models.Local: clusterInfo, err := localnet.GetClusterInfo() if err != nil {