File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import (
1010 "os"
1111 "path/filepath"
1212
13+ "golang.org/x/mod/semver"
14+
1315 validatorManagerSDK "github.com/ava-labs/avalanche-cli/sdk/validatormanager"
1416
1517 "github.com/ava-labs/avalanche-cli/pkg/blockchain"
@@ -472,6 +474,22 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
472474
473475 ux .Logger .PrintToUser ("Deploying %s to %s" , chains , network .Name ())
474476
477+ if network .Kind == models .Fuji && userProvidedAvagoVersion == "" {
478+ latestAvagoVersion , err := app .Downloader .GetLatestReleaseVersion (
479+ constants .AvaLabsOrg ,
480+ constants .AvalancheGoRepoName ,
481+ "" ,
482+ )
483+ if err != nil {
484+ return err
485+ }
486+ versionComparison := semver .Compare (constants .FujiAvalancheGoV113 , latestAvagoVersion )
487+ if versionComparison == 1 {
488+ userProvidedAvagoVersion = constants .FujiAvalancheGoV113
489+ }
490+ return nil
491+ }
492+
475493 if network .Kind == models .Local {
476494 app .Log .Debug ("Deploy local" )
477495
Original file line number Diff line number Diff line change 88 "strings"
99 "time"
1010
11+ "golang.org/x/mod/semver"
12+
1113 "github.com/ava-labs/avalanche-cli/pkg/binutils"
1214 "github.com/ava-labs/avalanche-cli/pkg/blockchain"
1315 "github.com/ava-labs/avalanche-cli/pkg/cobrautils"
@@ -183,6 +185,21 @@ func localStartNode(_ *cobra.Command, args []string) error {
183185 StakingCertKeyPath : stakingCertKeyPath ,
184186 StakingTLSKeyPath : stakingTLSKeyPath ,
185187 }
188+ // TODO: remove this check for releases above v1.8.7, once v1.13.0-fuji avalanchego is latest release
189+ if globalNetworkFlags .UseFuji && useCustomAvalanchegoVersion == "" {
190+ latestAvagoVersion , err := app .Downloader .GetLatestReleaseVersion (
191+ constants .AvaLabsOrg ,
192+ constants .AvalancheGoRepoName ,
193+ "" ,
194+ )
195+ if err != nil {
196+ return err
197+ }
198+ versionComparison := semver .Compare (constants .FujiAvalancheGoV113 , latestAvagoVersion )
199+ if versionComparison == 1 {
200+ useCustomAvalanchegoVersion = constants .FujiAvalancheGoV113
201+ }
202+ }
186203 if useCustomAvalanchegoVersion != "" {
187204 latestAvagoPreReleaseVersion = false
188205 latestAvagoReleaseVersion = false
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ const (
292292 NotAvailableLabel = "Not available"
293293 BackendCmd = "avalanche-cli-backend"
294294
295+ FujiAvalancheGoV113 = "v1.13.0-fuji"
295296 AvalancheGoCompatibilityURL = "https://raw.githubusercontent.com/ava-labs/avalanchego/master/version/compatibility.json"
296297 SubnetEVMRPCCompatibilityURL = "https://raw.githubusercontent.com/ava-labs/subnet-evm/master/compatibility.json"
297298
You can’t perform that action at this time.
0 commit comments