From 0111072c8be1b54b3e323b140ea5a5a2d6cb4c39 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 29 Aug 2023 12:44:36 -0500 Subject: [PATCH 1/5] Add eth-api-proxyt to mainnet-eth stack. --- .../docker-compose-mainnet-eth-api-proxy.yml | 16 ++++++++++++++++ app/data/config/mainnet-eth-api-proxy/ethpxy.env | 7 +++++++ .../container-build/cerc-eth-api-proxy/build.sh | 9 +++++++++ app/data/stacks/mainnet-eth/stack.yml | 3 +++ 4 files changed, 35 insertions(+) create mode 100644 app/data/compose/docker-compose-mainnet-eth-api-proxy.yml create mode 100644 app/data/config/mainnet-eth-api-proxy/ethpxy.env create mode 100755 app/data/container-build/cerc-eth-api-proxy/build.sh diff --git a/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml new file mode 100644 index 00000000..6a68b0ff --- /dev/null +++ b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml @@ -0,0 +1,16 @@ +version: '3.8' + +services: + redis: + hostname: mainnet-eth-api-proxy-redis + image: redis:7-alpine + env_file: + - ../config/mainnet-eth-api-proxy/ethpxy.env + + eth-api-proxy: + hostname: mainnet-eth-api-proxy + image: cerc/eth-api-proxy:local + env_file: + - ../config/mainnet-eth-api-proxy/ethpxy.env + ports: + - 8547 \ No newline at end of file diff --git a/app/data/config/mainnet-eth-api-proxy/ethpxy.env b/app/data/config/mainnet-eth-api-proxy/ethpxy.env new file mode 100644 index 00000000..f96a3586 --- /dev/null +++ b/app/data/config/mainnet-eth-api-proxy/ethpxy.env @@ -0,0 +1,7 @@ +CERC_ETHPXY_LISTEN_PORT=8547 +CERC_ETHPXY_LISTEN_ADDR='0.0.0.0' +CERC_ETHPXY_REDIS_URL='redis://mainnet-eth-api-proxy-redis:6379' +CERC_ETHPXY_GETH_WS_URL='ws://mainnet-eth-geth-1:8546' +CERC_ETHPXY_GETH_HTTP_URL='http://mainnet-eth-geth-1:8545' + +REDIS_ARGS="--maxmemory-policy allkeys-lru --maxmemory 1G" \ No newline at end of file diff --git a/app/data/container-build/cerc-eth-api-proxy/build.sh b/app/data/container-build/cerc-eth-api-proxy/build.sh new file mode 100755 index 00000000..e21e7f9d --- /dev/null +++ b/app/data/container-build/cerc-eth-api-proxy/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Build cerc/eth-api-proxy + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/eth-api-proxy:local ${build_command_args} ${CERC_REPO_BASE_DIR}/eth-api-proxy diff --git a/app/data/stacks/mainnet-eth/stack.yml b/app/data/stacks/mainnet-eth/stack.yml index be63e972..32497682 100644 --- a/app/data/stacks/mainnet-eth/stack.yml +++ b/app/data/stacks/mainnet-eth/stack.yml @@ -7,6 +7,7 @@ repos: - github.com/dboreham/foundry - git.vdb.to/cerc-io/keycloak-reg-api - git.vdb.to/cerc-io/keycloak-reg-ui + - github.com/vulcanize/eth-api-proxy containers: - cerc/go-ethereum - cerc/lighthouse @@ -16,8 +17,10 @@ containers: - cerc/webapp-base - cerc/keycloak-reg-api - cerc/keycloak-reg-ui + - cerc/eth-api-proxy pods: - mainnet-eth - mainnet-eth-keycloak - mainnet-eth-metrics + - mainnet-eth-api-proxy - foundry -- 2.45.2 From 0c5ca81f1ddd8593e94c124f2fff8dbb9ed7516a Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 29 Aug 2023 17:59:43 +0000 Subject: [PATCH 2/5] Missing args --- app/data/stacks/mainnet-eth/deploy/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/stacks/mainnet-eth/deploy/commands.py b/app/data/stacks/mainnet-eth/deploy/commands.py index 09586aac..51e21a29 100644 --- a/app/data/stacks/mainnet-eth/deploy/commands.py +++ b/app/data/stacks/mainnet-eth/deploy/commands.py @@ -23,7 +23,7 @@ def setup(ctx): return None -def create(ctx): +def create(ctx, extra_args): # Generate the JWT secret and save to its config file secret = token_hex(32) jwt_file_path = ctx.deployment_dir.joinpath("data", "mainnet_eth_config_data", "jwtsecret") -- 2.45.2 From 5033224b18c7c907cd3f70f68f5c167506178d3a Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 29 Aug 2023 18:22:44 +0000 Subject: [PATCH 3/5] Set redis max age. --- app/data/config/mainnet-eth-api-proxy/ethpxy.env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/data/config/mainnet-eth-api-proxy/ethpxy.env b/app/data/config/mainnet-eth-api-proxy/ethpxy.env index f96a3586..fd56288a 100644 --- a/app/data/config/mainnet-eth-api-proxy/ethpxy.env +++ b/app/data/config/mainnet-eth-api-proxy/ethpxy.env @@ -1,7 +1,8 @@ CERC_ETHPXY_LISTEN_PORT=8547 CERC_ETHPXY_LISTEN_ADDR='0.0.0.0' CERC_ETHPXY_REDIS_URL='redis://mainnet-eth-api-proxy-redis:6379' +CERC_ETHPXY_REDIS_MAX_AGE=120000 CERC_ETHPXY_GETH_WS_URL='ws://mainnet-eth-geth-1:8546' CERC_ETHPXY_GETH_HTTP_URL='http://mainnet-eth-geth-1:8545' -REDIS_ARGS="--maxmemory-policy allkeys-lru --maxmemory 1G" \ No newline at end of file +REDIS_ARGS="--maxmemory-policy allkeys-lru --maxmemory 1G" -- 2.45.2 From 250ccf9b0b0d17060c36ae5b13e49fdfab7961c7 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 29 Aug 2023 14:20:28 -0500 Subject: [PATCH 4/5] eol --- app/data/compose/docker-compose-mainnet-eth-api-proxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml index 6a68b0ff..83f09179 100644 --- a/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml +++ b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml @@ -13,4 +13,4 @@ services: env_file: - ../config/mainnet-eth-api-proxy/ethpxy.env ports: - - 8547 \ No newline at end of file + - 8547 -- 2.45.2 From b0dffe3bbc58d5f5ff92f20e550c961934be7f04 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 29 Aug 2023 14:49:51 -0500 Subject: [PATCH 5/5] Fix redis cfg --- app/data/compose/docker-compose-mainnet-eth-api-proxy.yml | 3 +-- app/data/config/mainnet-eth-api-proxy/ethpxy.env | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml index 83f09179..8e3b0845 100644 --- a/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml +++ b/app/data/compose/docker-compose-mainnet-eth-api-proxy.yml @@ -4,8 +4,7 @@ services: redis: hostname: mainnet-eth-api-proxy-redis image: redis:7-alpine - env_file: - - ../config/mainnet-eth-api-proxy/ethpxy.env + command: redis-server --save "" --appendonly no --maxmemory-policy allkeys-lru --maxmemory 1G eth-api-proxy: hostname: mainnet-eth-api-proxy diff --git a/app/data/config/mainnet-eth-api-proxy/ethpxy.env b/app/data/config/mainnet-eth-api-proxy/ethpxy.env index fd56288a..aeed33d1 100644 --- a/app/data/config/mainnet-eth-api-proxy/ethpxy.env +++ b/app/data/config/mainnet-eth-api-proxy/ethpxy.env @@ -4,5 +4,3 @@ CERC_ETHPXY_REDIS_URL='redis://mainnet-eth-api-proxy-redis:6379' CERC_ETHPXY_REDIS_MAX_AGE=120000 CERC_ETHPXY_GETH_WS_URL='ws://mainnet-eth-geth-1:8546' CERC_ETHPXY_GETH_HTTP_URL='http://mainnet-eth-geth-1:8545' - -REDIS_ARGS="--maxmemory-policy allkeys-lru --maxmemory 1G" -- 2.45.2