Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 9 additions & 1 deletion cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ so you can take your locally tested Subnet and deploy it on Fuji or Mainnet.`,
cmd.Flags().StringSliceVar(&aggregatorExtraEndpoints, "aggregator-extra-endpoints", nil, "endpoints for extra nodes that are needed in signature aggregation")
cmd.Flags().BoolVar(&useLocalMachine, "use-local-machine", false, "use local machine as a blockchain validator")
cmd.Flags().IntVar(&numBootstrapValidators, "num-bootstrap-validators", 0, "(only if --generate-node-id is true) number of bootstrap validators to set up in sovereign L1 validator)")
cmd.Flags().IntVar(&numLocalNodes, "num-local-nodes", 1, "number of nodes to be created on local machine")
cmd.Flags().IntVar(&numLocalNodes, "num-local-nodes", 0, "number of nodes to be created on local machine")
cmd.Flags().StringVar(&changeOwnerAddress, "change-owner-address", "", "address that will receive change if node is no longer L1 validator")

cmd.Flags().Uint64Var(&poSMinimumStakeAmount, "pos-minimum-stake-amount", 1, "minimum stake amount")
Expand Down Expand Up @@ -615,6 +615,9 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
network = models.ConvertClusterToNetwork(network)
}
}
if numLocalNodes > 0 {
useLocalMachine = true
}
// ask user if we want to use local machine if cluster is not provided
if network.Kind != models.Local && !useLocalMachine && clusterNameFlagValue == "" {
ux.Logger.PrintToUser("You can use your local machine as a bootstrap validator on the blockchain")
Expand All @@ -625,6 +628,11 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
return err
}
}
// default number of local machine nodes to be 1
// we set it here instead of at flag level so that we don't prompt if user wants to use local machine when they set numLocalNodes flag value
if useLocalMachine && numLocalNodes == 0 {
numLocalNodes = constants.DefaultNumberOfLocalMachineNodes
}
// if no cluster provided - we create one with fmt.Sprintf("%s-local-node", blockchainName) name
if useLocalMachine && clusterNameFlagValue == "" {
// stop local avalanchego process so that we can generate new local cluster
Expand Down
21 changes: 11 additions & 10 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,17 @@ const (
PluginDir = "plugins"
LocalDir = "local"

MetricsNetwork = "network"
MultiSig = "multi-sig"
SkipUpdateFlag = "skip-update-check"
LastFileName = ".last_actions.json"
APIRole = "API"
ValidatorRole = "Validator"
MonitorRole = "Monitor"
AWMRelayerRole = "Relayer"
LoadTestRole = "LoadTest"
DefaultWalletCreationTimeout = 5 * time.Second
DefaultNumberOfLocalMachineNodes = 1
MetricsNetwork = "network"
MultiSig = "multi-sig"
SkipUpdateFlag = "skip-update-check"
LastFileName = ".last_actions.json"
APIRole = "API"
ValidatorRole = "Validator"
MonitorRole = "Monitor"
AWMRelayerRole = "Relayer"
LoadTestRole = "LoadTest"
DefaultWalletCreationTimeout = 5 * time.Second

DefaultConfirmTxTimeout = 20 * time.Second

Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/testcases/subnet/sov/etna/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func deployEtnaSubnetEtnaFlag() {
"deploy",
subnetName,
"--etna-devnet",
"--use-local-machine",
"--num-local-nodes=1",
"--ewoq",
"--change-owner-address",
Expand Down Expand Up @@ -131,7 +130,6 @@ func deployEtnaSubnetEtnaFlagConvertOnly() {
"deploy",
subnetName,
"--etna-devnet",
"--use-local-machine",
"--num-local-nodes=1",
"--convert-only",
"--ewoq",
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/testcases/validatormanager/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func createSovereignSubnet() (string, string, error) {
"deploy",
subnetName,
"--etna-devnet",
"--use-local-machine",
"--num-local-nodes=1",
"--ewoq",
"--convert-only",
Expand Down