Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssv flag different validator dir #222

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/templates/eth2.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
stop_grace_period: 3m
ports: [ "${BN_P2P_PORT:-9001}:${BN_P2P_PORT:-9001}/tcp", "${BN_P2P_PORT:-9001}:${BN_P2P_PORT:-9001}/udp"${BN_OPEN_PORTS} ]
volumes:
- ${STADER_DATA_FOLDER}/validators:/validators
- ${STADER_DATA_FOLDER}/${VALIDATORS_DIR_NAME}:/validators
- ${STADER_DATA_FOLDER}/secrets:/secrets:ro
- eth2clientdata:/ethclient
- ${STADER_FOLDER}/scripts:/setup:ro
Expand Down
2 changes: 1 addition & 1 deletion install/templates/validator.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
restart: unless-stopped
stop_grace_period: 3m
volumes:
- ${STADER_DATA_FOLDER}/validators:/validators
- ${STADER_DATA_FOLDER}/${VALIDATORS_DIR_NAME}:/validators
- ${STADER_FOLDER}/scripts:/setup:ro
- ${STADER_FOLDER}/addons:/addons
networks:
Expand Down
4 changes: 4 additions & 0 deletions shared/services/config/stader-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@
envVars["TX_FEE_CAP"] = fmt.Sprintf("%d", int64(txFeeCap))
envVars["TX_FEE_CAP_IN_GWEI"] = fmt.Sprintf("%d", int64(txFeeCapInGwei))
envVars["SSV_MODE"] = fmt.Sprintf("%v", cfg.IsSSVMode)
envVars["VALIDATORS_DIR_NAME"] = "validators" // default validators dir name
if cfg.IsSSVMode {

Check failure on line 864 in shared/services/config/stader-config.go

View workflow job for this annotation

GitHub Actions / Lint

only one cuddle assignment allowed before if statement (wsl)
envVars["VALIDATORS_DIR_NAME"] = "presign" // sets the directory name for validator info in case of ssv mode is set to true.
}
config.AddParametersToEnvVars(cfg.StaderNode.GetParameters(), envVars)
config.AddParametersToEnvVars(cfg.GetParameters(), envVars)

Expand Down
8 changes: 6 additions & 2 deletions shared/services/config/stadernode-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,15 @@ func (cfg *StaderNodeConfig) GetSpRewardCyclePath(cycle int64, daemon bool) stri
}

func (cfg *StaderNodeConfig) GetFeeRecipientFilePath() string {
validatorDirName := "validators"
if cfg.parent.IsSSVMode {
validatorDirName = "presign"
}
if !cfg.parent.IsNativeMode {
return filepath.Join(DaemonDataPath, "validators", FeeRecipientFilename)
return filepath.Join(DaemonDataPath, validatorDirName, FeeRecipientFilename)
}

return filepath.Join(cfg.DataPath.Value.(string), "validators", NativeFeeRecipientFilename)
return filepath.Join(cfg.DataPath.Value.(string), validatorDirName, NativeFeeRecipientFilename)
}

func (cfg *StaderNodeConfig) GetClaimData(cycles []*big.Int) ([]*big.Int, []*big.Int, [][][32]byte, error) {
Expand Down