From 7abd13ab36241358077b5deda8180d7a3702f015 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 20 Jan 2023 10:16:59 -0300 Subject: [PATCH 1/4] ci/deploy: enable healthbot in testnet again Signed-off-by: Ignacio Hagopian --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 35820664..db6593fc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -70,7 +70,7 @@ jobs: git fetch && git checkout -f ${{ github.sha }} cd docker - make testnet-up + HEALTHBOT_ENABLED=true make testnet-up # Wait to start and double-check we're running the expected version. # This helps having a green check in the GH Action be high-signal that everything is fine. From b112162054f90507e3cb1dc6450eddf9255d8916 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 20 Jan 2023 10:44:25 -0300 Subject: [PATCH 2/4] dockerfile: update go compiler, grafana and prometheus Signed-off-by: Ignacio Hagopian --- cmd/api/Dockerfile | 2 +- cmd/api/Dockerfile.debug | 2 +- cmd/healthbot/Dockerfile | 2 +- docker/deployed/docker-compose.observability.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/api/Dockerfile b/cmd/api/Dockerfile index 9dd13b07..32f0a571 100644 --- a/cmd/api/Dockerfile +++ b/cmd/api/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19.0-alpine as builder +FROM golang:1.19.5-alpine as builder RUN apk --no-cache add make build-base git diff --git a/cmd/api/Dockerfile.debug b/cmd/api/Dockerfile.debug index 78027ff1..7cfd46c6 100644 --- a/cmd/api/Dockerfile.debug +++ b/cmd/api/Dockerfile.debug @@ -1,4 +1,4 @@ -FROM golang:1.19.0-alpine as builder +FROM golang:1.19.5-alpine as builder RUN apk --no-cache add make build-base git diff --git a/cmd/healthbot/Dockerfile b/cmd/healthbot/Dockerfile index c857c928..595490a6 100644 --- a/cmd/healthbot/Dockerfile +++ b/cmd/healthbot/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19.0-alpine as builder +FROM golang:1.19.5-alpine as builder RUN apk --no-cache add make build-base git diff --git a/docker/deployed/docker-compose.observability.yml b/docker/deployed/docker-compose.observability.yml index 31e52cde..b53106c3 100644 --- a/docker/deployed/docker-compose.observability.yml +++ b/docker/deployed/docker-compose.observability.yml @@ -1,6 +1,6 @@ services: prometheus: - image: prom/prometheus:v2.39.1 + image: prom/prometheus:v2.41.0 container_name: prometheus volumes: - ${PWD}/observability/prometheus:/etc/prometheus @@ -12,7 +12,7 @@ services: restart: unless-stopped grafana: - image: grafana/grafana:9.2.2 + image: grafana/grafana:9.3.2 container_name: grafana volumes: - ${PWD}/observability/grafana/provisioning:/etc/grafana/provisioning From c211710bb38f6bfbd8871a76551416c285fdf527 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 20 Jan 2023 11:25:59 -0300 Subject: [PATCH 3/4] healthbot: multiple fixes [testnetdeploy] Signed-off-by: Ignacio Hagopian --- cmd/healthbot/config.go | 1 + cmd/healthbot/main.go | 2 +- docker/deployed/testnet/healthbot/.env_healthbot.example | 4 ++++ docker/deployed/testnet/healthbot/config.json | 6 +++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/healthbot/config.go b/cmd/healthbot/config.go index 2ef19251..c00e70a5 100644 --- a/cmd/healthbot/config.go +++ b/cmd/healthbot/config.go @@ -29,6 +29,7 @@ type config struct { type ChainConfig struct { ChainID int WalletPrivateKey string + AlchemyAPIKey string Probe struct { CheckInterval string `default:"15s"` ReceiptTimeout string `default:"20s"` diff --git a/cmd/healthbot/main.go b/cmd/healthbot/main.go index 0aa6a99d..918bf0a2 100644 --- a/cmd/healthbot/main.go +++ b/cmd/healthbot/main.go @@ -49,7 +49,7 @@ func main() { log.Fatal().Int("chain_id", chainCfg.ChainID).Msg("the chain id isn't supported in the Tableland client") } - client, err := clientV1.NewClient(ctx, wallet, clientV1.NewClientChain(chain)) + client, err := clientV1.NewClient(ctx, wallet, clientV1.NewClientChain(chain), clientV1.NewClientAlchemyAPIKey(chainCfg.AlchemyAPIKey)) if err != nil { log.Fatal().Err(err).Msg("error creating tbl client") } diff --git a/docker/deployed/testnet/healthbot/.env_healthbot.example b/docker/deployed/testnet/healthbot/.env_healthbot.example index a4116f96..a15c4227 100644 --- a/docker/deployed/testnet/healthbot/.env_healthbot.example +++ b/docker/deployed/testnet/healthbot/.env_healthbot.example @@ -1,9 +1,13 @@ HEALTHBOT_ETHEREUM_GOERLI_PRIVATE_KEY= +HEALTHBOT_ETHEREUM_GOERLI_API_KEY= HEALTHBOT_ETHEREUM_GOERLI_TABLE= HEALTHBOT_POLYGON_MUMBAI_PRIVATE_KEY= +HEALTHBOT_POLYGON_MUMBAI_API_KEY= HEALTHBOT_POLYGON_MUMBAI_TABLE= HEALTHBOT_ARBITRUM_GOERLI_PRIVATE_KEY= +HEALTHBOT_ARBITRUM_GOERLI_API_KEY= HEALTHBOT_ARBITRUM_GOERLI_TABLE= HEALTHBOT_OPTIMISM_GOERLI_PRIVATE_KEY= +HEALTHBOT_OPTIMISM_GOERLI_API_KEY= HEALTHBOT_OPTIMISM_GOERLI_TABLE= diff --git a/docker/deployed/testnet/healthbot/config.json b/docker/deployed/testnet/healthbot/config.json index d7ffbdf8..c293ad8a 100644 --- a/docker/deployed/testnet/healthbot/config.json +++ b/docker/deployed/testnet/healthbot/config.json @@ -8,8 +8,9 @@ }, "Chains": [ { - "Name": 421613, + "ChainID": 421613, "WalletPrivateKey": "${HEALTHBOT_ARBITRUM_GOERLI_PRIVATE_KEY}", + "AlchemyAPIKey": "${HEALTHBOT_ALCHEMY_ARBITRUM_GOERLI_API_KEY}", "Probe": { "CheckInterval": "360s", "ReceiptTimeout": "25s", @@ -19,6 +20,7 @@ { "ChainID": 5, "WalletPrivateKey": "${HEALTHBOT_ETHEREUM_GOERLI_PRIVATE_KEY}", + "AlchemyAPIKey": "${HEALTHBOT_ALCHEMY_ETHEREUM_GOERLI_API_KEY}", "Probe": { "CheckInterval": "1h", "ReceiptTimeout": "90s", @@ -28,6 +30,7 @@ { "ChainID": 80001, "WalletPrivateKey": "${HEALTHBOT_POLYGON_MUMBAI_PRIVATE_KEY}", + "AlchemyAPIKey": "${HEALTHBOT_ALCHEMY_POLYGON_MUMBAI_API_KEY}", "Probe": { "CheckInterval": "240s", "ReceiptTimeout": "40s", @@ -37,6 +40,7 @@ { "ChainID": 420, "WalletPrivateKey": "${HEALTHBOT_OPTIMISM_GOERLI_PRIVATE_KEY}", + "AlchemyAPIKey": "${HEALTHBOT_ALCHEMY_OPTIMISM_GOERLI_API_KEY}", "Probe": { "CheckInterval": "360s", "ReceiptTimeout": "25s", From c172ef3afaa418645a6a0c8b512f121ea39f1373 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 20 Jan 2023 11:35:18 -0300 Subject: [PATCH 4/4] lints & config changes for staging Signed-off-by: Ignacio Hagopian --- Makefile | 2 +- cmd/healthbot/main.go | 3 ++- docker/deployed/staging/healthbot/.env_healthbot.example | 4 +++- docker/deployed/staging/healthbot/config.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4e919e4c..d1231295 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ test-replayhistory: # Lint lint: - go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0 run + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1 run .PHONY: lint # OpenAPI diff --git a/cmd/healthbot/main.go b/cmd/healthbot/main.go index 918bf0a2..426c70a1 100644 --- a/cmd/healthbot/main.go +++ b/cmd/healthbot/main.go @@ -49,7 +49,8 @@ func main() { log.Fatal().Int("chain_id", chainCfg.ChainID).Msg("the chain id isn't supported in the Tableland client") } - client, err := clientV1.NewClient(ctx, wallet, clientV1.NewClientChain(chain), clientV1.NewClientAlchemyAPIKey(chainCfg.AlchemyAPIKey)) + client, err := clientV1.NewClient( + ctx, wallet, clientV1.NewClientChain(chain), clientV1.NewClientAlchemyAPIKey(chainCfg.AlchemyAPIKey)) if err != nil { log.Fatal().Err(err).Msg("error creating tbl client") } diff --git a/docker/deployed/staging/healthbot/.env_healthbot.example b/docker/deployed/staging/healthbot/.env_healthbot.example index fae7a781..74618d74 100644 --- a/docker/deployed/staging/healthbot/.env_healthbot.example +++ b/docker/deployed/staging/healthbot/.env_healthbot.example @@ -1,2 +1,4 @@ HEALTHBOT_OPTIMISM_GOERLI_PRIVATE_KEY= -HEALTHBOT_OPTIMISM_GOERLI_TABLE= \ No newline at end of file +HEALTHBOT_OPTIMISM_GOERLI_API_KEY= +HEALTHBOT_OPTIMISM_GOERLI_TABLE= + diff --git a/docker/deployed/staging/healthbot/config.json b/docker/deployed/staging/healthbot/config.json index 8598c10e..114581b2 100644 --- a/docker/deployed/staging/healthbot/config.json +++ b/docker/deployed/staging/healthbot/config.json @@ -8,8 +8,9 @@ }, "Chains": [ { - "ChainID": 5, + "ChainID": 420, "WalletPrivateKey": "${HEALTHBOT_OPTIMISM_GOERLI_PRIVATE_KEY}", + "AlchemyAPIKey": "${HEALTHBOT_OPTIMISM_GOERLI_API_KEY}", "Probe": { "CheckInterval": "360s", "ReceiptTimeout": "20s",