diff --git a/cmd/geth/main.go b/cmd/geth/main.go index de78563dcb..e2bc7dba6d 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -122,7 +122,7 @@ var ( utils.GpoBlocksFlag, utils.GpoPercentileFlag, utils.ExtraDataFlag, - utils.ValidatorSetFlag, + utils.JoinValidatorSetFlag, configFileFlag, } diff --git a/cmd/geth/shardingcmd.go b/cmd/geth/shardingcmd.go index 48d887bf03..66451f9e12 100644 --- a/cmd/geth/shardingcmd.go +++ b/cmd/geth/shardingcmd.go @@ -14,7 +14,7 @@ var ( Aliases: []string{"shard"}, Usage: "Start a sharding client", ArgsUsage: "[endpoint]", - Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.ValidatorSetFlag}, + Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.JoinValidatorSetFlag}, Category: "SHARDING COMMANDS", Description: ` Launches a sharding client that connects to a running geth node and proposes collations to a Validator Manager Contract. This feature is a work in progress. diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 98c6e7fc6e..188fdecfd8 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -539,9 +539,9 @@ var ( } //Sharding Settings - ValidatorSetFlag = cli.BoolFlag{ + JoinValidatorSetFlag = cli.BoolFlag{ Name: "validator", - Usage: "Join validator set", + Usage: "To become a validator with your sharding client, 100 ETH will be deposited from user's account into VMC ", } ) diff --git a/sharding/vmc.go b/sharding/vmc.go index 9e21436b64..bf6e67e499 100644 --- a/sharding/vmc.go +++ b/sharding/vmc.go @@ -56,11 +56,9 @@ func initVMC(c *Client) error { // the account is not in the set, it will deposit 100ETH into contract. func joinValidatorSet(c *Client) error { - // TODO: Check if account is already in validator set. Fetch this From - // the VMC contract's validator set - if c.ctx.GlobalBool(utils.ValidatorSetFlag.Name) { + if c.ctx.GlobalBool(utils.JoinValidatorSetFlag.Name) { - log.Info(fmt.Sprintf("Joining Validator Set")) + log.Info("Joining validator set") txOps, err := c.createTXOps(depositSize) if err != nil { return fmt.Errorf("unable to intiate the deposit transaction: %v", err) @@ -70,10 +68,10 @@ func joinValidatorSet(c *Client) error { if err != nil { return fmt.Errorf("unable to deposit eth and become a validator: %v", err) } - log.Info(fmt.Sprintf("Deposited 100ETH into contract with transaction hash: %s", tx.Hash().String())) + log.Info(fmt.Sprintf("Deposited %dETH into contract with transaction hash: %s", depositSize, tx.Hash().String())) } else { - log.Info(fmt.Sprintf("Not Joining Validator Set")) + log.Info("Not joining validator set") } return nil