Skip to content

Commit

Permalink
Merge branch 'main' into remove-permission-err
Browse files Browse the repository at this point in the history
  • Loading branch information
sukantoraymond authored Dec 13, 2024
2 parents c7facd4 + ae77533 commit f409617
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,9 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
if network.Kind == models.Fuji {
globalNetworkFlags.UseFuji = true
}
if network.Kind == models.Mainnet {
globalNetworkFlags.UseMainnet = true
}
// anrSettings, avagoVersionSettings, globalNetworkFlags are empty
if err = node.StartLocalNode(
app,
Expand Down Expand Up @@ -1228,7 +1231,6 @@ func setBootstrapValidatorValidationID(avaGoBootstrapValidators []*txs.ConvertSu
}
}


func getClusterBootstrapValidators(
clusterName string,
network models.Network,
Expand Down
2 changes: 1 addition & 1 deletion cmd/nodecmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
)

var (
createSupportedNetworkOptions = []networkoptions.NetworkOption{networkoptions.Fuji, networkoptions.Devnet, networkoptions.EtnaDevnet}
createSupportedNetworkOptions = []networkoptions.NetworkOption{networkoptions.Fuji, networkoptions.Devnet, networkoptions.EtnaDevnet, networkoptions.Mainnet}
globalNetworkFlags networkoptions.NetworkFlags
useAWS bool
useGCP bool
Expand Down
3 changes: 2 additions & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const (
APIRequestLargeTimeout = 10 * time.Second
FastGRPCDialTimeout = 100 * time.Millisecond

FujiBootstrapTimeout = 15 * time.Minute
FujiBootstrapTimeout = 15 * time.Minute
MainnetBootstrapTimeout = 2 * time.Hour

SSHServerStartTimeout = 1 * time.Minute
SSHScriptTimeout = 2 * time.Minute
Expand Down
5 changes: 4 additions & 1 deletion pkg/models/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,11 @@ func (n *Network) Equals(n2 Network) bool {
// Context for bootstrapping a partial synced Node
func (n *Network) BootstrappingContext() (context.Context, context.CancelFunc) {
timeout := constants.ANRRequestTimeout
if n.Kind == Fuji {
switch n.Kind {
case Fuji:
timeout = constants.FujiBootstrapTimeout
case Mainnet:
timeout = constants.MainnetBootstrapTimeout
}
return context.WithTimeout(context.Background(), timeout)
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/node/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ func StartLocalNode(
constants.FujiAPIEndpoint,
clusterName,
)
case globalNetworkFlags.UseMainnet:
network = models.NewNetwork(
models.Mainnet,
avagoconstants.MainnetID,
constants.MainnetAPIEndpoint,
clusterName,
)
default:
network, err = networkoptions.GetNetworkFromCmdLineFlags(
app,
Expand All @@ -337,6 +344,8 @@ func StartLocalNode(
}
if network.Kind == models.Fuji {
ux.Logger.PrintToUser(logging.Yellow.Wrap("Warning: Fuji Bootstrapping can take several minutes"))
} else if network.Kind == models.Mainnet {
ux.Logger.PrintToUser(logging.Yellow.Wrap("Warning: Mainnet Bootstrapping can take 1-2 hours"))
}
if err := preLocalChecks(anrSettings, avaGoVersionSetting, useEtnaDevnet, globalNetworkFlags); err != nil {
return err
Expand Down

0 comments on commit f409617

Please sign in to comment.