-
Notifications
You must be signed in to change notification settings - Fork 1
/
start_core.sh
executable file
·115 lines (97 loc) · 2.17 KB
/
start_core.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env bash
COMPOSE_FILENAME="core.compose.yml"
ENV_FILE=".env"
help()
{
echo "
Usage: ./start_core.sh [ --no-gw ]
[ --no-mqtt ]
[ --db ]
[ --tv ]
[ -h | --help ]"
exit 2
}
SHORT=h
LONG=no-gw,db,no-mqtt,tv,help
OPTS=$(getopt -a -n rm_bot.sh --options $SHORT --longoptions $LONG -- "$@")
VALID_ARGUMENTS=$# # Returns the count of arguments that are in short or long options
eval set -- "$OPTS"
EXCLUDE_DB=1
EXCLUDE_TRADINGVIEW=1
EXCLUDE_DASHBOARD=1
while :
do
case "$1" in
--db )
unset EXCLUDE_DB
shift;
;;
--no-gw )
EXCLUDE_GATEWAY=1
shift;
;;
--no-mqtt )
EXCLUDE_MQTT=1
shift;
;;
--tv )
unset EXCLUDE_TRADINGVIEW
shift;
;;
-h | --help)
help
;;
--)
shift;
break
;;
*)
echo "Unexpected option: $1"
help
;;
esac
done
PROFILES=""
if [ -z $EXCLUDE_GATEWAY ]; then
PROFILES="${PROFILES} --profile gateway"
fi
if [ -z $EXCLUDE_DB ]; then
PROFILES="${PROFILES} --profile db"
fi
if [ -z $EXCLUDE_MQTT ]; then
PROFILES="${PROFILES} --profile mqtt"
fi
if [ -z $EXCLUDE_DASHBOARD ]; then
PROFILES="${PROFILES} --profile dashboard"
fi
if [ -z $EXCLUDE_TRADINGVIEW ]; then
PROFILES="${PROFILES} --profile tradingview"
fi
set -o allexport
source $ENV_FILE
set +o allexport
echo """
Starting Hummingbot Core...
Gateway Parameters:
- Image: ${GW_IMAGE}
- Port: ${GW_PORT}
- Passphrase: ${GW_PASSPHRASE}
MQTT Broker Parameters:
- Image: ${MQTT_EMQX_IMAGE}
PostgresDB Parameters:
- Image: ${DB_IMAGE}
- Name: ${DB_NAME}
- User: ${DB_USER}
- Password: ${DB_PASSWORD}
TradingView Bridge Parameters:
- Image: ${TV_BRIDGE_IMAGE}
- Security Key: ${TV_BRIDGE_SEC_KEY}
- MQTT Topic: ${TV_BRIDGE_MQTT_TOPIC}
Dashboard Parameters:
- Image: ${DASHBOARD_IMAGE}
- Port: ${DASHBOARD_PORT}
"""
docker compose -f ./compose/${COMPOSE_FILENAME} down && \
docker compose -f ./compose/${COMPOSE_FILENAME} \
${PROFILES} \
up --remove-orphans