Skip to content

Commit d747b06

Browse files
committed
fly: watch additional heartbeat in mainnet
1 parent eb23282 commit d747b06

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

fly/cmd/fly/main.go

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
ipfslog "github.com/ipfs/go-log/v2"
2020
"github.com/joho/godotenv"
2121
"github.com/libp2p/go-libp2p/core/crypto"
22+
fly_common "github.com/wormhole-foundation/wormhole-monitor/fly/common"
2223
"github.com/wormhole-foundation/wormhole-monitor/fly/utils"
2324
"github.com/wormhole-foundation/wormhole/sdk/vaa"
2425

@@ -129,6 +130,7 @@ func loadEnvVars() {
129130
rpcUrl = verifyEnvVar("RPC_URL")
130131
coreBridgeAddr = verifyEnvVar("CORE_BRIDGE_ADDR")
131132
credentialsFile = verifyEnvVar("CREDENTIALS_FILE")
133+
network = verifyEnvVar("NETWORK")
132134
}
133135

134136
func verifyEnvVar(key string) string {
@@ -220,6 +222,12 @@ func main() {
220222
if err != nil {
221223
logger.Fatal("Failed to fetch guardian set", zap.String("rpc", rpcUrl), zap.Error(err))
222224
}
225+
if env == common.MainNet {
226+
// watch heartbeats for standby guardians
227+
for _, ge := range fly_common.StandbyMainnetGuardians {
228+
sgs.Keys = append(sgs.Keys, eth_common.HexToAddress(ge.Address))
229+
}
230+
}
223231
logger.Info("guardian set", zap.Uint32("index", idx), zap.Any("gs", sgs))
224232
gs := common.GuardianSet{
225233
Keys: sgs.Keys,

fly/common/consts.go

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ var MainnetGuardians = []GuardianEntry{
3939
{18, "Staking Facilities", "0x6FbEBc898F403E4773E95feB15E80C9A99c8348d"},
4040
}
4141

42+
var StandbyMainnetGuardians = []GuardianEntry{
43+
{19, "Google Cloud", "0x68c16a92903c4c74ffddc730582ba53d967d3dac"},
44+
}
45+
4246
// Although there are multiple testnet guardians running, they all use the same key, so it looks like one.
4347
var TestnetGuardians = []GuardianEntry{
4448
{0, "Testnet", "0x13947Bd48b18E53fdAeEe77F3473391aC727C638"},

0 commit comments

Comments
 (0)