Use demo config for accounts create (#3627)

This commit is contained in:
Preston Van Loon 2019-09-27 15:48:49 -07:00 committed by terence tsao
parent 877f596c54
commit 00e68c6cc7
2 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,7 @@ go_library(
"//shared/debug:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/params:go_default_library",
"//shared/version:go_default_library",
"//validator/flags:go_default_library",
"//validator/node:go_default_library",
@ -46,6 +47,7 @@ go_image(
"//shared/debug:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/params:go_default_library",
"//shared/version:go_default_library",
"//validator/flags:go_default_library",
"//validator/node:go_default_library",

View File

@ -10,6 +10,7 @@ import (
"github.com/prysmaticlabs/prysm/shared/debug"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/logutil"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/version"
"github.com/prysmaticlabs/prysm/validator/flags"
"github.com/prysmaticlabs/prysm/validator/node"
@ -86,6 +87,19 @@ contract in order to activate the validator client`,
flags.PasswordFlag,
},
Action: func(ctx *cli.Context) {
featureconfig.ConfigureValidatorFeatures(ctx)
// Use custom config values if the --no-custom-config flag is set.
if !ctx.GlobalBool(flags.NoCustomConfigFlag.Name) {
log.Info("Using custom parameter configuration")
if featureconfig.FeatureConfig().MinimalConfig {
log.Warn("Using Minimal Config")
params.UseMinimalConfig()
} else {
log.Warn("Using Demo Config")
params.UseDemoBeaconConfig()
}
}
if keystoreDir, _, err := node.CreateValidatorAccount(ctx); err != nil {
log.Fatalf("Could not create validator at path: %s", keystoreDir)
}