Skip to content

Commit

Permalink
fly: watch additional heartbeat in mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Aug 21, 2024
1 parent eb23282 commit d747b06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fly/cmd/fly/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
ipfslog "github.com/ipfs/go-log/v2"
"github.com/joho/godotenv"
"github.com/libp2p/go-libp2p/core/crypto"
fly_common "github.com/wormhole-foundation/wormhole-monitor/fly/common"
"github.com/wormhole-foundation/wormhole-monitor/fly/utils"
"github.com/wormhole-foundation/wormhole/sdk/vaa"

Expand Down Expand Up @@ -129,6 +130,7 @@ func loadEnvVars() {
rpcUrl = verifyEnvVar("RPC_URL")
coreBridgeAddr = verifyEnvVar("CORE_BRIDGE_ADDR")
credentialsFile = verifyEnvVar("CREDENTIALS_FILE")
network = verifyEnvVar("NETWORK")
}

func verifyEnvVar(key string) string {
Expand Down Expand Up @@ -220,6 +222,12 @@ func main() {
if err != nil {
logger.Fatal("Failed to fetch guardian set", zap.String("rpc", rpcUrl), zap.Error(err))
}
if env == common.MainNet {
// watch heartbeats for standby guardians
for _, ge := range fly_common.StandbyMainnetGuardians {
sgs.Keys = append(sgs.Keys, eth_common.HexToAddress(ge.Address))
}
}
logger.Info("guardian set", zap.Uint32("index", idx), zap.Any("gs", sgs))
gs := common.GuardianSet{
Keys: sgs.Keys,
Expand Down
4 changes: 4 additions & 0 deletions fly/common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ var MainnetGuardians = []GuardianEntry{
{18, "Staking Facilities", "0x6FbEBc898F403E4773E95feB15E80C9A99c8348d"},
}

var StandbyMainnetGuardians = []GuardianEntry{
{19, "Google Cloud", "0x68c16a92903c4c74ffddc730582ba53d967d3dac"},
}

// Although there are multiple testnet guardians running, they all use the same key, so it looks like one.
var TestnetGuardians = []GuardianEntry{
{0, "Testnet", "0x13947Bd48b18E53fdAeEe77F3473391aC727C638"},
Expand Down

0 comments on commit d747b06

Please sign in to comment.