From 2baa290d1d553b8bc41cddf86133fcec2f11d65e Mon Sep 17 00:00:00 2001 From: tscrond Date: Fri, 4 Apr 2025 10:22:17 +0200 Subject: [PATCH 1/4] add ethereum-sidecar.server.network flag support --- docker/compose.yaml | 1 + docker/mainnet.env.example | 1 + docker/testnet.env.example | 1 + native/v-kit.sh | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/compose.yaml b/docker/compose.yaml index 1512f6a..ebc1aff 100644 --- a/docker/compose.yaml +++ b/docker/compose.yaml @@ -49,6 +49,7 @@ services: - ethereum-sidecar - --log_format=json - --ethereum-sidecar.server.ethereum-node-address=${MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS} + - --ethereum-sidecar.server.network=${MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK} restart: always expose: - 7500 diff --git a/docker/mainnet.env.example b/docker/mainnet.env.example index 84e44f8..59ffc72 100644 --- a/docker/mainnet.env.example +++ b/docker/mainnet.env.example @@ -29,6 +29,7 @@ MEZOD_CHAIN_ID="mezo_31612-1" MEZOD_HOME="/var/mezod" MEZOD_MONIKER="" MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" # Ethereum Mainnet WS RPC +MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="" # Ethereum network (mainnet) MEZOD_LOG_LEVEL=info MEZOD_LOG_FORMAT=json # json|plain MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup diff --git a/docker/testnet.env.example b/docker/testnet.env.example index 432419d..8e8bd54 100644 --- a/docker/testnet.env.example +++ b/docker/testnet.env.example @@ -29,6 +29,7 @@ MEZOD_CHAIN_ID="mezo_31611-1" MEZOD_HOME="/var/mezod" MEZOD_MONIKER="" MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" +MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="" # Ethereum network (testnet - Sepolia) MEZOD_LOG_LEVEL=info MEZOD_LOG_FORMAT=json # json|plain MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup diff --git a/native/v-kit.sh b/native/v-kit.sh index 8f09011..cddd046 100755 --- a/native/v-kit.sh +++ b/native/v-kit.sh @@ -183,6 +183,7 @@ configure_mezo() { ${MEZO_EXEC} toml set \ ${app_config_file} \ + -v ethereum-sidecar.server.network="${MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK}" \ -v ethereum-sidecar.client.server-address="0.0.0.0:7500" \ -v api.enable=true \ -v api.address="tcp://0.0.0.0:1317" \ @@ -245,7 +246,7 @@ After=network.target [Service] Restart=no ExecStartPre=/bin/echo "Starting ethereum-sidecar systemd initialization..." -ExecStart=${MEZO_EXEC} ethereum-sidecar --log_format=${MEZOD_LOG_FORMAT} --ethereum-sidecar.server.ethereum-node-address=${MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS} +ExecStart=${MEZO_EXEC} ethereum-sidecar --log_format=${MEZOD_LOG_FORMAT} --ethereum-sidecar.server.network=${MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK} --ethereum-sidecar.server.ethereum-node-address=${MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS} StandardOutput=journal StandardError=journal User=root From d9cfc135c298857a5d93674df78f13b35d44f6f1 Mon Sep 17 00:00:00 2001 From: tscrond Date: Fri, 4 Apr 2025 10:29:19 +0200 Subject: [PATCH 2/4] add ethereum-sidecar.server.network flag support for k8s --- helm-chart/mezod/templates/statefulset.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helm-chart/mezod/templates/statefulset.yaml b/helm-chart/mezod/templates/statefulset.yaml index 7e9fb20..e647313 100644 --- a/helm-chart/mezod/templates/statefulset.yaml +++ b/helm-chart/mezod/templates/statefulset.yaml @@ -136,12 +136,18 @@ spec: - --home=/tmp/dummy-data - --log_format=json - --ethereum-sidecar.server.ethereum-node-address=$(ETHEREUM_ENDPOINT) + - --ethereum-sidecar.server.network=$(ETHEREUM_NETWORK) env: - name: ETHEREUM_ENDPOINT valueFrom: secretKeyRef: name: {{ .Values.secrets.credentials | quote }} key: ETHEREUM_ENDPOINT + - name: ETHEREUM_NETWORK + valueFrom: + secretKeyRef: + name: {{ .Values.secrets.credentials | quote }} + key: ETHEREUM_NETWORK ports: - name: client containerPort: 7500 From a188af11b7eca41a3f2d47577bdcf05987f26233 Mon Sep 17 00:00:00 2001 From: tscrond Date: Fri, 4 Apr 2025 11:45:40 +0200 Subject: [PATCH 3/4] add MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK env variable to example configs --- native/mainnet.env.example | 1 + native/testnet.env.example | 1 + 2 files changed, 2 insertions(+) diff --git a/native/mainnet.env.example b/native/mainnet.env.example index 650e110..d3c8eb3 100755 --- a/native/mainnet.env.example +++ b/native/mainnet.env.example @@ -16,6 +16,7 @@ export MEZOD_ETHEREUM_SIDECAR_CLIENT_SERVER_ADDRESS="127.0.0.1:7500" # Address to an ethereum node (web socket address) # Example: wss://your.eth.node export MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" +export MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="mainnet" export MEZOD_LOG_FORMAT="json" export MEZOD_KEY_NAME="key0" export MEZOD_LOGLEVEL="info" diff --git a/native/testnet.env.example b/native/testnet.env.example index 13feff1..9a17493 100755 --- a/native/testnet.env.example +++ b/native/testnet.env.example @@ -16,6 +16,7 @@ export MEZOD_ETHEREUM_SIDECAR_CLIENT_SERVER_ADDRESS="127.0.0.1:7500" # Address to an ethereum node (web socket address) # Example: wss://your.eth.node export MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" +export MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="sepolia" export MEZOD_LOG_FORMAT="json" export MEZOD_KEY_NAME="key0" export MEZOD_LOGLEVEL="info" From 087b5aebf94e8e7fd55c8908a91a99c751737158 Mon Sep 17 00:00:00 2001 From: tscrond Date: Fri, 4 Apr 2025 12:16:45 +0200 Subject: [PATCH 4/4] hardcode values for ethereum sidecar network + address comments for helm chart --- docker/mainnet.env.example | 2 +- docker/testnet.env.example | 2 +- helm-chart/mezod/templates/statefulset.yaml | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docker/mainnet.env.example b/docker/mainnet.env.example index 59ffc72..60809b1 100644 --- a/docker/mainnet.env.example +++ b/docker/mainnet.env.example @@ -29,7 +29,7 @@ MEZOD_CHAIN_ID="mezo_31612-1" MEZOD_HOME="/var/mezod" MEZOD_MONIKER="" MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" # Ethereum Mainnet WS RPC -MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="" # Ethereum network (mainnet) +MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="mainnet" MEZOD_LOG_LEVEL=info MEZOD_LOG_FORMAT=json # json|plain MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup diff --git a/docker/testnet.env.example b/docker/testnet.env.example index 8e8bd54..5e730df 100644 --- a/docker/testnet.env.example +++ b/docker/testnet.env.example @@ -29,7 +29,7 @@ MEZOD_CHAIN_ID="mezo_31611-1" MEZOD_HOME="/var/mezod" MEZOD_MONIKER="" MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="" -MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="" # Ethereum network (testnet - Sepolia) +MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="sepolia" MEZOD_LOG_LEVEL=info MEZOD_LOG_FORMAT=json # json|plain MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup diff --git a/helm-chart/mezod/templates/statefulset.yaml b/helm-chart/mezod/templates/statefulset.yaml index e647313..e48f011 100644 --- a/helm-chart/mezod/templates/statefulset.yaml +++ b/helm-chart/mezod/templates/statefulset.yaml @@ -136,18 +136,17 @@ spec: - --home=/tmp/dummy-data - --log_format=json - --ethereum-sidecar.server.ethereum-node-address=$(ETHEREUM_ENDPOINT) - - --ethereum-sidecar.server.network=$(ETHEREUM_NETWORK) + {{- if eq .Values.env.NETWORK "mainnet" }} + - --ethereum-sidecar.server.network=mainnet + {{- else if eq .Values.env.NETWORK "testnet" }} + - --ethereum-sidecar.server.network=sepolia + {{- end }} env: - name: ETHEREUM_ENDPOINT valueFrom: secretKeyRef: name: {{ .Values.secrets.credentials | quote }} key: ETHEREUM_ENDPOINT - - name: ETHEREUM_NETWORK - valueFrom: - secretKeyRef: - name: {{ .Values.secrets.credentials | quote }} - key: ETHEREUM_NETWORK ports: - name: client containerPort: 7500