Add job runner and server scripts in common folder
This commit is contained in:
parent
039f696574
commit
4ae58dbd71
@ -34,9 +34,9 @@ services:
|
|||||||
command: ["bash", "./start-job-runner.sh"]
|
command: ["bash", "./start-job-runner.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml
|
- ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-sushiswap-v2/start-job-runner.sh:/app/packages/v2-watcher/start-job-runner.sh
|
- ../config/common/start-job-runner.sh:/app/packages/v2-watcher/start-job-runner.sh
|
||||||
ports:
|
ports:
|
||||||
- "9000:9000"
|
- "9000"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -61,7 +61,7 @@ services:
|
|||||||
command: ["bash", "./start-server.sh"]
|
command: ["bash", "./start-server.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml
|
- ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-sushiswap-v2/start-server.sh:/app/packages/v2-watcher/start-server.sh
|
- ../config/common/start-server.sh:/app/packages/v2-watcher/start-server.sh
|
||||||
- sushiswap_v2_watcher_gql_logs_data:/app/packages/v2-watcher/gql-logs
|
- sushiswap_v2_watcher_gql_logs_data:/app/packages/v2-watcher/gql-logs
|
||||||
ports:
|
ports:
|
||||||
- "3008"
|
- "3008"
|
||||||
|
@ -34,9 +34,9 @@ services:
|
|||||||
command: ["bash", "./start-job-runner.sh"]
|
command: ["bash", "./start-job-runner.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml
|
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-sushiswap-v3/start-job-runner.sh:/app/packages/v3-watcher/start-job-runner.sh
|
- ../config/common/start-job-runner.sh:/app/packages/v3-watcher/start-job-runner.sh
|
||||||
ports:
|
ports:
|
||||||
- "9000:9000"
|
- "9000"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -61,7 +61,7 @@ services:
|
|||||||
command: ["bash", "./start-server.sh"]
|
command: ["bash", "./start-server.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml
|
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-sushiswap-v3/start-server.sh:/app/packages/v3-watcher/start-server.sh
|
- ../config/common/start-server.sh:/app/packages/v3-watcher/start-server.sh
|
||||||
- sushiswap_v3_watcher_gql_logs_data:/app/packages/v3-watcher/gql-logs
|
- sushiswap_v3_watcher_gql_logs_data:/app/packages/v3-watcher/gql-logs
|
||||||
ports:
|
ports:
|
||||||
- "3008"
|
- "3008"
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
set -u
|
|
||||||
|
|
||||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
|
||||||
|
|
||||||
# Read in the config template TOML file and modify it
|
|
||||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
|
||||||
|
|
||||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
|
||||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
|
||||||
|
|
||||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
|
||||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
|
||||||
|
|
||||||
# Write the modified content to a new file
|
|
||||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
|
||||||
|
|
||||||
echo "Running job-runner..."
|
|
||||||
DEBUG=vulcanize:* exec node --enable-source-maps dist/job-runner.js
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
set -u
|
|
||||||
|
|
||||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
|
||||||
|
|
||||||
# Read in the config template TOML file and modify it
|
|
||||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
|
||||||
|
|
||||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
|
||||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
|
||||||
|
|
||||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
|
||||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
|
||||||
|
|
||||||
# Write the modified content to a new file
|
|
||||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
|
||||||
|
|
||||||
echo "Running server..."
|
|
||||||
DEBUG=vulcanize:* exec node --enable-source-maps dist/server.js
|
|
@ -3,7 +3,7 @@
|
|||||||
## Clone the stack repo
|
## Clone the stack repo
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so fetch-stack git.vdb.to/deep-stack/sushiswap-watcher-ts
|
laconic-so fetch-stack git.vdb.to/cerc-io/sushiswap-watcher-ts
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build the container image
|
## Build the container image
|
||||||
|
Loading…
Reference in New Issue
Block a user