From a4d18b4d11363d91ce96290899d9cb7c04e6f4b8 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Mon, 30 Dec 2024 12:09:18 +0100 Subject: [PATCH] Add stakers ui url --- internal/application/services/relaysChecker.go | 6 +++++- internal/config/config_loader.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/application/services/relaysChecker.go b/internal/application/services/relaysChecker.go index 5c35114..eb17ffd 100644 --- a/internal/application/services/relaysChecker.go +++ b/internal/application/services/relaysChecker.go @@ -12,6 +12,7 @@ import ( ) type RelayCronService struct { + stakersUiUrl string relaysAllowedPort ports.RelaysAllowedPort relaysUsedPort ports.RelaysUsedPort notifierPort ports.NotifierPort @@ -19,11 +20,13 @@ type RelayCronService struct { } func NewRelayCronService( + stakersUiUrl string, relaysAllowedPort ports.RelaysAllowedPort, relaysUsedPort ports.RelaysUsedPort, notifierPort ports.NotifierPort, ) *RelayCronService { return &RelayCronService{ + stakersUiUrl: stakersUiUrl, relaysAllowedPort: relaysAllowedPort, relaysUsedPort: relaysUsedPort, notifierPort: notifierPort, @@ -134,6 +137,7 @@ func (rcs *RelayCronService) buildMissingMandatoryNotification(allowedRelays []d for _, relay := range allowedRelays { message += fmt.Sprintf("\n- `%s`", relay.Uri) } + message += "\n\nEdit your relays in the Stakers UI to use at least one mandatory relay." + rcs.stakersUiUrl return message } @@ -142,6 +146,6 @@ func (rcs *RelayCronService) buildBlacklistNotification(blacklistedRelays []stri for _, relay := range blacklistedRelays { message += fmt.Sprintf("- `%s`\n", relay) } - message += "\nPlease review and address these issues promptly." + message += "\nPlease edit your relays in the Stakers UI to use only allowed relays." + rcs.stakersUiUrl return message } diff --git a/internal/config/config_loader.go b/internal/config/config_loader.go index de03eee..485dad1 100644 --- a/internal/config/config_loader.go +++ b/internal/config/config_loader.go @@ -22,6 +22,7 @@ type Config struct { EtherscanURL string BeaconchainURL string CSMUIURL string + StakersUiUrl string ApiPort uint64 CORS []string @@ -154,6 +155,7 @@ func LoadNetworkConfig() (Config, error) { EtherscanURL: "https://holesky.etherscan.io", BeaconchainURL: beaconchainURL, CSMUIURL: "https://csm.testnet.fi", + StakersUiUrl: "http://my.dappnode/stakers/holesky", ApiPort: apiPort, CORS: parseCORS(corsEnv, []string{"http://ui.lido-csm-holesky.dappnode", "http://my.dappnode"}), CSAccountingAddress: common.HexToAddress("0x4562c3e63c2e586cD1651B958C22F88135aCAd4f"), @@ -192,6 +194,7 @@ func LoadNetworkConfig() (Config, error) { EtherscanURL: "https://etherscan.io", BeaconchainURL: beaconchainURL, CSMUIURL: "https://csm.lido.fi", + StakersUiUrl: "http://my.dappnode/stakers/ethereum", ApiPort: apiPort, CORS: parseCORS(corsEnv, []string{"http://ui.lido-csm-mainnet.dappnode", "http://my.dappnode"}), CSAccountingAddress: common.HexToAddress("0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F"),