Repository: tablelandnetwork/go-tableland
Pull request #440 (2023-01-20 14:28:12)

Healthbot fixes and re-enabling & Docker images updating
# Summary

This PR:
- Fixes some stuff in the new healthbot that sends the transactions directly instead of relying on validator relaying.
- Updates some base Docker images to not fall behind in having everything up to date at the infra level.

# Context

NA

# Implementation overview

NA

# Implementation details and review orientation

NA





Patch:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 3582066..db6593f 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.
diff --git a/Makefile b/Makefile
index 4e919e4..d123129 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/api/Dockerfile b/cmd/api/Dockerfile
index 9dd13b0..32f0a57 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 78027ff..7cfd46c 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 c857c92..595490a 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/cmd/healthbot/config.go b/cmd/healthbot/config.go
index 2ef1925..c00e70a 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 0aa6a99..426c70a 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))
+		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/docker-compose.observability.yml b/docker/deployed/docker-compose.observability.yml
index 31e52cd..b53106c 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
diff --git a/docker/deployed/staging/healthbot/.env_healthbot.example b/docker/deployed/staging/healthbot/.env_healthbot.example
index fae7a78..74618d7 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 8598c10..114581b 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",


Test patch:
diff --git a/docker/deployed/testnet/healthbot/.env_healthbot.example b/docker/deployed/testnet/healthbot/.env_healthbot.example
index a4116f9..a15c422 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 d7ffbdf..c293ad8 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",