the contract-migration server things 'works'

This commit is contained in:
Blair Vanderlugt 2021-09-23 17:56:15 +03:00
parent e3144cb780
commit ad25e0a38d
4 changed files with 23 additions and 7 deletions

View File

@ -14,8 +14,8 @@ fi
if [[ "$CONTRACT_MIGRATION_URL" ]]; then if [[ "$CONTRACT_MIGRATION_URL" ]]; then
echo "waiting for $CONTRACT_MIGRATION_URL/readyz" echo "waiting for $CONTRACT_MIGRATION_URL/readyz"
./wait-for-it.sh $CONTRACT_MIGRATION_URL -t $WAIT_FOR_TIMEOUT docker/wait-for-it.sh $CONTRACT_MIGRATION_URL -t $WAIT_FOR_TIMEOUT
source ./get_readyz.sh # set env vars form endpoint source docker/get_readyz.sh # set env vars form endpoint
/usr/local/bin/cic-cache-trackerd $@ /usr/local/bin/cic-cache-trackerd $@
else else
/usr/local/bin/cic-cache-trackerd $@ /usr/local/bin/cic-cache-trackerd $@

View File

@ -1,5 +1,17 @@
#!/bin/bash #!/bin/bash
set -e
set -u
. ./db.sh . ./db.sh
/usr/local/bin/cic-eth-trackerd $@ WAIT_FOR_TIMEOUT=${WAIT_FOR_TIMEOUT:-600}
if [[ "$CONTRACT_MIGRATION_URL" ]]; then
echo "waiting for $CONTRACT_MIGRATION_URL/readyz"
./wait-for-it.sh $CONTRACT_MIGRATION_URL -t $WAIT_FOR_TIMEOUT
source ./get_readyz.sh # set env vars form endpoint
/usr/local/bin/cic-eth-trackerd $@
else
/usr/local/bin/cic-eth-trackerd $@
fi

View File

@ -12,7 +12,10 @@ if [[ $((RUN_MASK & 1)) -eq 1 ]]
then then
>&2 echo -e "\033[;96mRUNNING\033[;39m RUN_MASK 1 - contract deployment" >&2 echo -e "\033[;96mRUNNING\033[;39m RUN_MASK 1 - contract deployment"
./reset.sh ./reset.sh
./docker/init_readyz.sh 2>&1 & # cic-eth-xxx services rely on
export RUN_MASK_PHASE=1
./docker/init_readyz.sh &
echo 0
if [ $? -ne "0" ]; then if [ $? -ne "0" ]; then
>&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 1 - contract deployment" >&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 1 - contract deployment"
exit 1; exit 1;
@ -24,12 +27,11 @@ if [[ $((RUN_MASK & 2)) -eq 2 ]]
then then
>&2 echo -e "\033[;96mRUNNING\033[;39m RUN_MASK 2 - custodial service initialization" >&2 echo -e "\033[;96mRUNNING\033[;39m RUN_MASK 2 - custodial service initialization"
./seed_cic_eth.sh ./seed_cic_eth.sh
./docker/init_readyz.sh
if [ $? -ne "0" ]; then if [ $? -ne "0" ]; then
>&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 2 - custodial service initialization" >&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 2 - custodial service initialization"
exit 1; exit 1;
fi fi
>&2 echo -e "\033[;32mSUCCEEDED\033[;39m RUN_MASK 2 - custodial service initialization" >&2 echo -e "\033[;32mSUCCEEDED\033[;39m RUN_MASK 2 - custodial service initialization"
fi fi
# this will leave the container up and serving the results of the migration
wait

View File

@ -363,6 +363,7 @@ services:
environment: environment:
RPC_PROVIDER: ${RPC_PROVIDER:-http://eth:8545} RPC_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
ETH_PROVIDER: ${RPC_PROVIDER:-http://eth:8545} ETH_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
RPC_HTTP_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
DATABASE_USER: ${DATABASE_USER:-grassroots} DATABASE_USER: ${DATABASE_USER:-grassroots}
DATABASE_HOST: ${DATABASE_HOST:-postgres} DATABASE_HOST: ${DATABASE_HOST:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala} DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala}
@ -454,6 +455,7 @@ services:
CIC_TX_RETRY_DELAY: 60 CIC_TX_RETRY_DELAY: 60
BATCH_SIZE: ${RETRIER_BATCH_SIZE:-50} BATCH_SIZE: ${RETRIER_BATCH_SIZE:-50}
#DATABASE_DEBUG: 1 #DATABASE_DEBUG: 1
CONTRACT_MIGRATION_URL: contract-migration:8000
restart: on-failure restart: on-failure
depends_on: depends_on:
- eth - eth