Skip to content

Commit

Permalink
Add beaconcha url in exit notification
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Dec 30, 2024
1 parent e361509 commit 743727c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func main() {
eventsWatcherService := services.NewEventsWatcherService(veboAdapter, csModuleAdapter, csFeeDistributorAdapter, notifierAdapter)
distributionLogUpdatedScannerService := services.NewDistributionLogUpdatedEventScanner(storageAdapter, notifierAdapter, executionAdapter, csFeeDistributorImplAdapter, networkConfig.CsFeeDistributorBlockDeployment, networkConfig.CSModuleTxReceipt)
validatorExitRequestScannerService := services.NewValidatorExitRequestEventScanner(storageAdapter, notifierAdapter, veboAdapter, executionAdapter, beaconchainAdapter, networkConfig.VeboBlockDeployment, networkConfig.CSModuleTxReceipt)
validatorEjectorService := services.NewValidatorEjectorService(storageAdapter, notifierAdapter, exitValidatorAdapter, beaconchainAdapter)
validatorEjectorService := services.NewValidatorEjectorService(networkConfig.BeaconchaUrl, storageAdapter, notifierAdapter, exitValidatorAdapter, beaconchainAdapter)
pendingHashesLoaderService := services.NewPendingHashesLoader(storageAdapter, notifierAdapter, ipfsAdapter, networkConfig.MinGenesisTime)
// relaysCheckerService := services.NewRelayCronService(relaysAllowedAdapter, relaysUsedAdapter, notifierAdapter)

Expand Down
6 changes: 4 additions & 2 deletions internal/application/services/validatorEjector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import (
)

type ValidatorEjector struct {
beaconchaUrl string
storagePort ports.StoragePort
notifierPort ports.NotifierPort
exitValidatorPort ports.ExitValidator
beaconchainPort ports.Beaconchain
servicePrefix string
}

func NewValidatorEjectorService(storagePort ports.StoragePort, notifierPort ports.NotifierPort, exitValidatorPort ports.ExitValidator, beaconchainPort ports.Beaconchain) *ValidatorEjector {
func NewValidatorEjectorService(beaconchaUrl string, storagePort ports.StoragePort, notifierPort ports.NotifierPort, exitValidatorPort ports.ExitValidator, beaconchainPort ports.Beaconchain) *ValidatorEjector {
return &ValidatorEjector{
beaconchaUrl,
storagePort,
notifierPort,
exitValidatorPort,
Expand Down Expand Up @@ -176,7 +178,7 @@ func (ve *ValidatorEjector) EjectValidator() error {

if validatorStatus == domain.StatusActiveExiting || validatorStatus == domain.StatusExitedUnslashed || validatorStatus == domain.StatusExitedSlashed {
logger.InfoWithPrefix(ve.servicePrefix, "Validator %s has entered the exit queue", exitRequest.Event.ValidatorIndex)
message = fmt.Sprintf("- 🚪 Validator %s has entered the exit queue automatically, no manual action required", exitRequest.Event.ValidatorIndex)
message = fmt.Sprintf("- 🚪 Validator %s has entered the exit queue automatically, no manual action required. See details here: %s/validator/%s", exitRequest.Event.ValidatorIndex, ve.beaconchaUrl, exitRequest.Event.ValidatorIndex)
if err := ve.notifierPort.SendNotification(message); err != nil {
logger.ErrorWithPrefix(ve.servicePrefix, "Error sending exit notification", err)
}
Expand Down
3 changes: 3 additions & 0 deletions internal/config/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Config struct {
CSMStakingModuleID *big.Int
EtherscanURL string
BeaconchainURL string
BeaconchaUrl string
CSMUIURL string
ApiPort uint64

Expand Down Expand Up @@ -153,6 +154,7 @@ func LoadNetworkConfig() (Config, error) {
CSMStakingModuleID: big.NewInt(4),
EtherscanURL: "https://holesky.etherscan.io",
BeaconchainURL: beaconchainURL,
BeaconchaUrl: "https://holesky.beaconcha.in",
CSMUIURL: "https://csm.testnet.fi",
ApiPort: apiPort,
CORS: parseCORS(corsEnv, []string{"http://ui.lido-csm-holesky.dappnode", "http://my.dappnode"}),
Expand Down Expand Up @@ -191,6 +193,7 @@ func LoadNetworkConfig() (Config, error) {
CSMStakingModuleID: big.NewInt(3),
EtherscanURL: "https://etherscan.io",
BeaconchainURL: beaconchainURL,
BeaconchaUrl: "https://beaconcha.in",
CSMUIURL: "https://csm.lido.fi",
ApiPort: apiPort,
CORS: parseCORS(corsEnv, []string{"http://ui.lido-csm-mainnet.dappnode", "http://my.dappnode"}),
Expand Down

0 comments on commit 743727c

Please sign in to comment.