Use env variables for ipld-eth-server endpoints
This commit is contained in:
parent
ddf756c68c
commit
3e8b87c3a7
@ -29,12 +29,16 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/azimuth-watcher
|
working_dir: /app/packages/azimuth-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/azimuth-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/azimuth-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/azimuth-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/azimuth-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/azimuth-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/azimuth-watcher/start-server.sh
|
||||||
ports:
|
ports:
|
||||||
@ -55,14 +59,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/censures-watcher
|
working_dir: /app/packages/censures-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/censures-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/censures-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/censures-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/censures-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/censures-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/censures-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3002"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3002"]
|
test: ["CMD", "nc", "-vz", "localhost", "3002"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -79,14 +89,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/claims-watcher
|
working_dir: /app/packages/claims-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/claims-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/claims-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/claims-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/claims-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/claims-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/claims-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3003"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3003"]
|
test: ["CMD", "nc", "-vz", "localhost", "3003"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -103,14 +119,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/conditional-star-release-watcher
|
working_dir: /app/packages/conditional-star-release-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/conditional-star-release-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/conditional-star-release-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/conditional-star-release-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/conditional-star-release-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/conditional-star-release-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/conditional-star-release-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3004"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3004"]
|
test: ["CMD", "nc", "-vz", "localhost", "3004"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -127,14 +149,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/delegated-sending-watcher
|
working_dir: /app/packages/delegated-sending-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/delegated-sending-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/delegated-sending-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/delegated-sending-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/delegated-sending-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/delegated-sending-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/delegated-sending-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3005"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3005"]
|
test: ["CMD", "nc", "-vz", "localhost", "3005"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -151,14 +179,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/ecliptic-watcher
|
working_dir: /app/packages/ecliptic-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/ecliptic-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/ecliptic-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/ecliptic-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/ecliptic-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/ecliptic-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/ecliptic-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3006"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3006"]
|
test: ["CMD", "nc", "-vz", "localhost", "3006"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -175,14 +209,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/linear-star-release-watcher
|
working_dir: /app/packages/linear-star-release-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/linear-star-release-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/linear-star-release-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/linear-star-release-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/linear-star-release-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/linear-star-release-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/linear-star-release-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3007"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3007"]
|
test: ["CMD", "nc", "-vz", "localhost", "3007"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
@ -199,14 +239,20 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
watcher-db:
|
watcher-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
env_file:
|
||||||
|
- ../config/watcher-azimuth/watcher-params.env
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||||
|
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||||
working_dir: /app/packages/polls-watcher
|
working_dir: /app/packages/polls-watcher
|
||||||
command: "./start-server.sh"
|
command: "./start-server.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-azimuth/watcher-config.toml:/app/packages/polls-watcher/environments/watcher-config.toml
|
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/polls-watcher/environments/watcher-config-template.toml
|
||||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/polls-watcher/merge-toml.js
|
- ../config/watcher-azimuth/merge-toml.js:/app/packages/polls-watcher/merge-toml.js
|
||||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/polls-watcher/start-server.sh
|
- ../config/watcher-azimuth/start-server.sh:/app/packages/polls-watcher/start-server.sh
|
||||||
|
ports:
|
||||||
|
- "3008"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "3008"]
|
test: ["CMD", "nc", "-vz", "localhost", "3008"]
|
||||||
interval: 20s
|
interval: 20s
|
||||||
|
@ -5,24 +5,23 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CERC_IPLD_ETH_RPC="${CERC_IPLD_ETH_RPC:-${DEFAULT_CERC_IPLD_ETH_RPC}}"
|
CERC_IPLD_ETH_RPC="${CERC_IPLD_ETH_RPC:-${DEFAULT_CERC_IPLD_ETH_RPC}}"
|
||||||
CERC_IPLD_GQL="${CERC_IPLD_GQL:-${DEFAULT_CERC_IPLD_GQL}}"
|
CERC_IPLD_ETH_GQL="${CERC_IPLD_ETH_GQL:-${DEFAULT_CERC_IPLD_ETH_GQL}}"
|
||||||
|
|
||||||
echo "Using IPLD ETH RPC endpoint ${CERC_IPLD_ETH_RPC}"
|
echo "Using IPLD ETH RPC endpoint ${CERC_IPLD_ETH_RPC}"
|
||||||
echo "Using IPLD GQL endpoint ${CERC_IPLD_GQL}"
|
echo "Using IPLD GQL endpoint ${CERC_IPLD_ETH_GQL}"
|
||||||
|
|
||||||
# # TODO: Replace env variables in template TOML file
|
# Replace env variables in template TOML file
|
||||||
# # Read in the config template TOML file and modify it
|
# Read in the config template TOML file and modify it
|
||||||
# WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||||
# WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||||
# sed -E "s|REPLACE_WITH_CERC_RELAY_PEERS|${CERC_RELAY_PEERS}|g; \
|
sed -E "s|REPLACE_WITH_CERC_IPLD_ETH_RPC|${CERC_IPLD_ETH_RPC}|g; \
|
||||||
# s|REPLACE_WITH_CERC_L2_GETH_RPC_ENDPOINT|${CERC_L2_GETH_RPC}| ")
|
s|REPLACE_WITH_CERC_IPLD_ETH_GQL|${CERC_IPLD_ETH_GQL}| ")
|
||||||
|
|
||||||
# # Write the modified content to a new file
|
# Write the modified content to a new file
|
||||||
# echo "$WATCHER_CONFIG" > environments/watcher-config.toml
|
echo "$WATCHER_CONFIG" > environments/watcher-config.toml
|
||||||
|
|
||||||
# Merge SO watcher config with existing config file
|
# Merge SO watcher config with existing config file
|
||||||
node merge-toml.js
|
node merge-toml.js
|
||||||
|
|
||||||
|
|
||||||
echo 'yarn server'
|
echo 'yarn server'
|
||||||
yarn server
|
yarn server
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[server]
|
[server]
|
||||||
host = "0.0.0.0"
|
host = "0.0.0.0"
|
||||||
|
maxSimultaneousRequests = -1
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
host = "watcher-db"
|
host = "watcher-db"
|
||||||
@ -9,5 +10,5 @@
|
|||||||
|
|
||||||
[upstream]
|
[upstream]
|
||||||
[upstream.ethServer]
|
[upstream.ethServer]
|
||||||
gqlApiEndpoint = "http://host.docker.internal:8083/graphql"
|
gqlApiEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_GQL"
|
||||||
rpcProviderEndpoint = "http://host.docker.internal:8082"
|
rpcProviderEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_RPC"
|
5
app/data/config/watcher-azimuth/watcher-params.env
Normal file
5
app/data/config/watcher-azimuth/watcher-params.env
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Defaults
|
||||||
|
|
||||||
|
# ipld-eth-server endpoints
|
||||||
|
DEFAULT_CERC_IPLD_ETH_RPC=
|
||||||
|
DEFAULT_CERC_IPLD_ETH_GQL=
|
@ -4,13 +4,15 @@ Instructions to setup and deploy Azimuth Watcher stack
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
Prerequisite: ipld-eth-server RPC and GQL endpoints
|
||||||
|
|
||||||
Clone required repositories:
|
Clone required repositories:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack azimuth setup-repositories
|
laconic-so --stack azimuth setup-repositories
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: If the repository already exists and checked out to different versions, `setup-repositories` command will throw an error.
|
NOTE: If the repository already exists and checked out to a different version, `setup-repositories` command will throw an error.
|
||||||
For getting around this, the `azimuth-watcher-ts` repository can be removed and then run the command.
|
For getting around this, the `azimuth-watcher-ts` repository can be removed and then run the command.
|
||||||
|
|
||||||
Checkout to the required versions and branches in repos
|
Checkout to the required versions and branches in repos
|
||||||
@ -29,12 +31,24 @@ laconic-so --stack azimuth build-containers
|
|||||||
|
|
||||||
This should create the required docker images in the local image registry.
|
This should create the required docker images in the local image registry.
|
||||||
|
|
||||||
Deploy the stack:
|
### Configuration
|
||||||
|
|
||||||
|
* Create and update an env file to be used in the next step:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# External ipld-eth-server endpoints
|
||||||
|
CERC_IPLD_ETH_RPC=
|
||||||
|
CERC_IPLD_ETH_GQL=
|
||||||
|
```
|
||||||
|
|
||||||
|
* NOTE: If ipld-eth-server is running on the host machine, use `host.docker.internal` as the hostname to access host ports
|
||||||
|
|
||||||
|
### Deploy the stack
|
||||||
|
|
||||||
* Deploy the containers:
|
* Deploy the containers:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack azimuth deploy-system up
|
laconic-so --stack azimuth deploy-system --env-file <PATH_TO_ENV_FILE> up
|
||||||
```
|
```
|
||||||
|
|
||||||
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
||||||
@ -44,7 +58,7 @@ Deploy the stack:
|
|||||||
Stop all the services running in background run:
|
Stop all the services running in background run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack azimuth deploy-system down 30
|
laconic-so --stack azimuth deploy-system down
|
||||||
```
|
```
|
||||||
|
|
||||||
Clear volumes created by this stack:
|
Clear volumes created by this stack:
|
||||||
|
Loading…
Reference in New Issue
Block a user