Skip to content

Commit

Permalink
refactor: readd the check and add separate statuscheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jlehtimaki committed Oct 31, 2023
1 parent cdc524e commit 1ddbb91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
go func(path *relayer.IBCdata) {
defer wg.Done()

// Client info
ci, err := ibc.GetClientsInfo(path, cc.RPCs)
status := successStatus

Expand All @@ -103,6 +104,9 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
[]string{(*cc.RPCs)[path.Chain2.ChainName].ChainID, path.Chain2.ClientID, (*cc.RPCs)[path.Chain1.ChainName].ChainID, status}...,
)

// Stuck packets
status = successStatus

stuckPackets, err := ibc.GetChannelsInfo(path, cc.RPCs)
if err != nil {
status = errorStatus
Expand Down
7 changes: 7 additions & 0 deletions pkg/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ func GetChannelsInfo(ibc *relayer.IBCdata, rpcs *map[string]config.RPC) (Channel
return ChannelsInfo{}, fmt.Errorf("Error: %w for %v", err, cdB)
}

// test that RPC endpoints are working
if _, _, err := relayer.QueryLatestHeights(
ctx, chainA, chainB,
); err != nil {
return channelInfo, fmt.Errorf("Error: %w for %v", err, cdA)
}

for i, c := range channelInfo.Channels {
var order chantypes.Order

Expand Down

0 comments on commit 1ddbb91

Please sign in to comment.