Skip to content

Commit b53c0d9

Browse files
remove duplicate flags
1 parent 5564014 commit b53c0d9

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

cmd/blockchaincmd/convert.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func newConvertCmd() *cobra.Command {
6262
6363
Sovereign L1s require bootstrap validators. avalanche blockchain convert command gives the option of:
6464
- either using local machine as bootstrap validators (set the number of bootstrap validators using
65-
--num-local-nodes flag, default is set to 1)
65+
--num-bootstrap-validators flag, default is set to 1)
6666
- or using remote nodes (we require the node's Node-ID and BLS info)`,
6767
RunE: convertBlockchain,
6868
PersistentPostRun: handlePostRun,
@@ -88,7 +88,6 @@ Sovereign L1s require bootstrap validators. avalanche blockchain convert command
8888
float64(constants.BootstrapValidatorBalanceNanoAVAX)/float64(units.Avax),
8989
"set the AVAX balance of each bootstrap validator that will be used for continuous fee on P-Chain",
9090
)
91-
cmd.Flags().IntVar(&numLocalNodes, "num-local-nodes", 0, "number of nodes to be created on local machine")
9291
cmd.Flags().UintSliceVar(&httpPorts, "http-port", []uint{}, "http port for node(s)")
9392
cmd.Flags().UintSliceVar(&stakingPorts, "staking-port", []uint{}, "staking port for node(s)")
9493
cmd.Flags().StringVar(&changeOwnerAddress, "change-owner-address", "", "address that will receive change if node is no longer L1 validator")
@@ -120,6 +119,7 @@ func StartLocalMachine(
120119
availableBalance uint64,
121120
httpPorts []uint,
122121
stakingPorts []uint,
122+
numBootstrapValidator int,
123123
) (bool, error) {
124124
var err error
125125
if network.Kind == models.Local {
@@ -141,9 +141,6 @@ func StartLocalMachine(
141141
network = models.ConvertClusterToNetwork(network)
142142
}
143143
}
144-
if numLocalNodes > 0 {
145-
useLocalMachine = true
146-
}
147144
// ask user if we want to use local machine if cluster is not provided
148145
if !useLocalMachine && clusterNameFlagValue == "" {
149146
ux.Logger.PrintToUser("You can use your local machine as a bootstrap validator on the blockchain")
@@ -156,8 +153,8 @@ func StartLocalMachine(
156153
}
157154
// default number of local machine nodes to be 1
158155
// 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
159-
if useLocalMachine && numLocalNodes == 0 {
160-
numLocalNodes = constants.DefaultNumberOfLocalMachineNodes
156+
if useLocalMachine && numBootstrapValidator == 0 {
157+
numBootstrapValidator = constants.DefaultNumberOfLocalMachineNodes
161158
}
162159
// if no cluster provided - we create one with fmt.Sprintf("%s-local-node-%s", blockchainName, networkNameComponent) name
163160
if useLocalMachine && clusterNameFlagValue == "" {
@@ -180,11 +177,11 @@ func StartLocalMachine(
180177
_ = localnet.LocalClusterRemove(app, clusterName)
181178
ux.Logger.GreenCheckmarkToUser("Local node %s cleaned up.", clusterName)
182179
}
183-
requiredBalance := deployBalance * uint64(numLocalNodes)
180+
requiredBalance := deployBalance * uint64(numBootstrapValidator)
184181
if availableBalance < requiredBalance {
185182
return false, fmt.Errorf(
186183
"required balance for %d validators dynamic fee on PChain is %d but the given key has %d",
187-
numLocalNodes,
184+
numBootstrapValidator,
188185
requiredBalance,
189186
availableBalance,
190187
)
@@ -243,7 +240,7 @@ func StartLocalMachine(
243240
app,
244241
clusterName,
245242
avagoBinaryPath,
246-
uint32(numLocalNodes),
243+
uint32(numBootstrapValidator),
247244
nodeConfig,
248245
localnet.ConnectionSettings{},
249246
nodeSettings,
@@ -670,6 +667,7 @@ func convertBlockchain(_ *cobra.Command, args []string) error {
670667
availableBalance,
671668
httpPorts,
672669
stakingPorts,
670+
numBootstrapValidators,
673671
); err != nil {
674672
return err
675673
} else if cancel {

cmd/blockchaincmd/deploy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ var (
6767
skipCreatePrompt bool
6868
avagoBinaryPath string
6969
numBootstrapValidators int
70-
numLocalNodes int
7170
httpPorts []uint
7271
stakingPorts []uint
7372
partialSync bool
@@ -168,7 +167,6 @@ so you can take your locally tested Blockchain and deploy it on Fuji or Mainnet.
168167
set.BoolVar(&generateNodeID, "generate-node-id", false, "whether to create new node id for bootstrap validators (Node-ID and BLS values in bootstrap JSON file will be overridden if --bootstrap-filepath flag is used)")
169168
set.StringSliceVar(&bootstrapEndpoints, "bootstrap-endpoints", nil, "take validator node info from the given endpoints")
170169
set.IntVar(&numBootstrapValidators, "num-bootstrap-validators", 0, "(only if --generate-node-id is true) number of bootstrap validators to set up in sovereign L1 validator)")
171-
set.IntVar(&numLocalNodes, "num-local-nodes", 0, "number of nodes to be created on local machine")
172170
set.Float64Var(
173171
&deployBalanceAVAX,
174172
"balance",
@@ -619,6 +617,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
619617
availableBalance,
620618
httpPorts,
621619
stakingPorts,
620+
numBootstrapValidators,
622621
); err != nil {
623622
return err
624623
} else if cancel {

tests/e2e/testcases/subnet/sov/etna/suite.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func deployEtnaSubnetEtnaFlag() {
224224
"deploy",
225225
utils.SubnetName,
226226
"--local",
227-
"--num-local-nodes=1",
227+
"--num-bootstrap-validators=1",
228228
"--ewoq",
229229
"--change-owner-address",
230230
ewoqPChainAddress,
@@ -252,7 +252,7 @@ func deployEtnaSubnetEtnaFlagConvertOnly() {
252252
"deploy",
253253
utils.SubnetName,
254254
"--local",
255-
"--num-local-nodes=1",
255+
"--num-bootstrap-validators=1",
256256
"--convert-only",
257257
"--ewoq",
258258
"--change-owner-address",

tests/e2e/testcases/validatormanager/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func createSovereignSubnet() (string, string, error) {
8282
"deploy",
8383
utils.SubnetName,
8484
"--local",
85-
"--num-local-nodes=1",
85+
"--num-bootstrap-validators=1",
8686
"--ewoq",
8787
"--convert-only",
8888
"--change-owner-address",

0 commit comments

Comments
 (0)