Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mainnet #2427

Merged
merged 9 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading