config: seperate priv validator config into seperate section (#6462)

Addresses a beginning component of #6255
This commit is contained in:
Sam Kleinman
2021-05-31 13:16:46 +00:00
committed by GitHub
parent 89b3b10740
commit 7bf84d9d7f
12 changed files with 137 additions and 109 deletions
+8 -8
View File
@@ -266,22 +266,22 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) {
// it's actually needed (e.g. for remote KMS or non-validators). We set up a dummy
// key here by default, and use the real key for actual validators that should use
// the file privval.
cfg.PrivValidatorListenAddr = ""
cfg.PrivValidatorKey = PrivvalDummyKeyFile
cfg.PrivValidatorState = PrivvalDummyStateFile
cfg.PrivValidator.ListenAddr = ""
cfg.PrivValidator.Key = PrivvalDummyKeyFile
cfg.PrivValidator.State = PrivvalDummyStateFile
switch node.Mode {
case e2e.ModeValidator:
switch node.PrivvalProtocol {
case e2e.ProtocolFile:
cfg.PrivValidatorKey = PrivvalKeyFile
cfg.PrivValidatorState = PrivvalStateFile
cfg.PrivValidator.Key = PrivvalKeyFile
cfg.PrivValidator.State = PrivvalStateFile
case e2e.ProtocolUNIX:
cfg.PrivValidatorListenAddr = PrivvalAddressUNIX
cfg.PrivValidator.ListenAddr = PrivvalAddressUNIX
case e2e.ProtocolTCP:
cfg.PrivValidatorListenAddr = PrivvalAddressTCP
cfg.PrivValidator.ListenAddr = PrivvalAddressTCP
case e2e.ProtocolGRPC:
cfg.PrivValidatorListenAddr = PrivvalAddressGRPC
cfg.PrivValidator.ListenAddr = PrivvalAddressGRPC
default:
return nil, fmt.Errorf("invalid privval protocol setting %q", node.PrivvalProtocol)
}