forked from subquery/subql-dictionary
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
46 lines (31 loc) · 1.19 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
#!/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_
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
# ----Installing Subql-query----
npm install -g @subql/[email protected]
# ----Installing Subql-Node----
npm install -g @subql/[email protected]
# ----Installing dependencies----
yarn
# ----Building Ternoa-Subql----
yarn codegen
# ----Codegen Ternoa-Subql----
yarn build