-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: F. Eugene Aumson <[email protected]>
- Loading branch information
Showing
52 changed files
with
1,599 additions
and
995 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax | ||
|
||
* @michaelkaplan13 @cam-schultz @minghinmatthewlam @gwen917 @geoff-vball @bernard-avalabs | ||
* @ava-labs/interop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,15 +22,10 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Set Go version | ||
run: | | ||
source ./scripts/versions.sh | ||
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version-file: 'go.mod' | ||
|
||
- name: Install buf | ||
uses: bufbuild/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ server.log | |
# Foundry outputs | ||
cache/ | ||
out/ | ||
|
||
# Release build outputs | ||
osxcross/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ linters: | |
- unconvert | ||
- unused | ||
- whitespace | ||
- lll | ||
|
||
linters-settings: | ||
gofmt: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net/http" | ||
|
||
"github.com/alexliesenfeld/health" | ||
"github.com/ava-labs/avalanchego/ids" | ||
"github.com/ava-labs/avalanchego/utils/logging" | ||
"go.uber.org/atomic" | ||
"go.uber.org/zap" | ||
) | ||
|
||
const HealthAPIPath = "/health" | ||
|
||
func HandleHealthCheck(logger logging.Logger, relayerHealth map[ids.ID]*atomic.Bool) { | ||
http.Handle(HealthAPIPath, healthCheckHandler(logger, relayerHealth)) | ||
} | ||
|
||
func healthCheckHandler(logger logging.Logger, relayerHealth map[ids.ID]*atomic.Bool) http.Handler { | ||
return health.NewHandler(health.NewChecker( | ||
health.WithCheck(health.Check{ | ||
Name: "relayers-all", | ||
Check: func(context.Context) error { | ||
// Store the IDs as the cb58 encoding | ||
var unhealthyRelayers []string | ||
for id, health := range relayerHealth { | ||
if !health.Load() { | ||
unhealthyRelayers = append(unhealthyRelayers, id.String()) | ||
} | ||
} | ||
|
||
if len(unhealthyRelayers) > 0 { | ||
logger.Fatal("Relayers are unhealthy for blockchains", zap.Strings("blockchains", unhealthyRelayers)) | ||
return fmt.Errorf("relayers are unhealthy for blockchains %v", unhealthyRelayers) | ||
} | ||
return nil | ||
}, | ||
}), | ||
)) | ||
} |
Oops, something went wrong.