forked from subquery/subql-dictionary
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_worker.sh
36 lines (24 loc) · 1.1 KB
/
run_worker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -e
set -x
[ -z "$APP_HOME" ] && export APP_HOME=$(pwd)
[ -z "$POSTGRESQL_ADDON_USER" ] && export POSTGRESQL_ADDON_USER="postgres"
[ -z "$DB_USER" ] && export DB_USER="$POSTGRESQL_ADDON_USER"
[ -z "$POSTGRESQL_ADDON_PASSWORD" ] && export POSTGRESQL_ADDON_PASSWORD="postgres"
[ -z "$DB_PASS" ] && export DB_PASS="$POSTGRESQL_ADDON_PASSWORD"
[ -z "$POSTGRESQL_ADDON_DB" ] && export POSTGRESQL_ADDON_DB="postgres"
[ -z "$DB_DATABASE" ] && export DB_DATABASE="$POSTGRESQL_ADDON_DB"
[ -z "$POSTGRESQL_ADDON_HOST" ] && export POSTGRESQL_ADDON_HOST="localhost"
[ -z "$DB_HOST" ] && export DB_HOST="$POSTGRESQL_ADDON_HOST"
[ -z "$POSTGRESQL_ADDON_PORT" ] && export POSTGRESQL_ADDON_PORT="5432"
[ -z "$DB_PORT" ] && export DB_PORT="$POSTGRESQL_ADDON_PORT"
env | grep DB_
[ -z "$TIMEOUT" ] && export TIMEOUT="50000"
if [ -z $1 ]; then
echo "Provide a network name (e.g. 'betanet', 'alphanet' or 'mainnet')"
exit 1
fi
sh ./scripts/prepare_folders.sh
cd ./networks/$1
npm install -g @subql/[email protected]
subql-node -f . --disable-historical=true --db-schema=subql-dictionary-ternoa --timeout $TIMEOUT