Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sukantoraymond committed Oct 9, 2024
1 parent 77c0fae commit 6707d5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
return err
}

clusterName, err := getClusterNameFromList()
clusterName, err := node.GetClusterNameFromList(app)
if err != nil {
return err
}
Expand Down Expand Up @@ -733,7 +733,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
); err != nil {
return err
}
ux.Logger.GreenCheckmarkToUser("Subnet is successfully converted into Subnet Only Validator")
ux.Logger.GreenCheckmarkToUser("L1 is successfully converted to sovereign blockchain")
} else {
if err := app.UpdateSidecarNetworks(&sidecar, network, subnetID, blockchainID, "", "", nil); err != nil {
return err
Expand Down
18 changes: 0 additions & 18 deletions cmd/blockchaincmd/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,3 @@ func UpdateKeychainWithSubnetControlKeys(
}
return nil
}

func getClusterNameFromList() (string, error) {
clusterNames, err := app.ListClusterNames()
if err != nil {
return "", err
}
if len(clusterNames) == 0 {
return "", fmt.Errorf("no Avalanche nodes found that can track the blockchain, please create Avalanche nodes first through `avalanche node create`")
}
clusterName, err := app.Prompt.CaptureList(
"Which cluster of Avalanche nodes would you like to use to track the blockchain?",
clusterNames,
)
if err != nil {
return "", err
}
return clusterName, nil
}
18 changes: 18 additions & 0 deletions pkg/node/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,21 @@ func WaitForHealthyCluster(
time.Sleep(poolTime)
}
}

func GetClusterNameFromList(app *application.Avalanche) (string, error) {
clusterNames, err := app.ListClusterNames()
if err != nil {
return "", err
}
if len(clusterNames) == 0 {
return "", fmt.Errorf("no Avalanche nodes found that can track the blockchain, please create Avalanche nodes first through `avalanche node create`")
}
clusterName, err := app.Prompt.CaptureList(
"Which cluster of Avalanche nodes would you like to use to track the blockchain?",
clusterNames,
)
if err != nil {
return "", err
}
return clusterName, nil
}

0 comments on commit 6707d5e

Please sign in to comment.