Skip to content

Commit

Permalink
Merge pull request ethereum#405 from etclabscore/feat/faucet-account-…
Browse files Browse the repository at this point in the history
…flags-required

cmd/faucet: add help notices and flag use audit for required account flags
  • Loading branch information
meowsbits committed Sep 16, 2021
2 parents 75b3eaa + 7e092bd commit 7aea05d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/faucet/faucet.go
Expand Up @@ -93,8 +93,8 @@ var (
minutesFlag = flag.Int("faucet.minutes", 1440, "Number of minutes to wait between funding rounds")
tiersFlag = flag.Int("faucet.tiers", 3, "Number of funding tiers to enable (x3 time, x2.5 funds)")

accJSONFlag = flag.String("account.json", "", "Key json file to fund user requests with")
accPassFlag = flag.String("account.pass", "", "Decryption password to access faucet funds")
accJSONFlag = flag.String("account.json", "", "[Required] Path to JSON key file to fund user requests with")
accPassFlag = flag.String("account.pass", "", "[Required] Path to plaintext file containing decryption password to access faucet funds")

captchaToken = flag.String("captcha.token", "", "Recaptcha site key to authenticate client side")
captchaSecret = flag.String("captcha.secret", "", "Recaptcha secret key to authenticate server side")
Expand Down Expand Up @@ -282,6 +282,13 @@ func auditFlagUse() {
log.Crit("invalid value for -syncmode", "value", *syncmodeFlag, "allowed", allowedModes)
}
}

if *accJSONFlag == "" {
log.Crit("missing required flag for path to account JSON file: --account.json")
}
if *accPassFlag == "" {
log.Crit("missing required flag for path to plaintext file containing account password: --account.pass")
}
}

func main() {
Expand Down

0 comments on commit 7aea05d

Please sign in to comment.