-
Notifications
You must be signed in to change notification settings - Fork 39
/
container_run.sh
executable file
·52 lines (45 loc) · 1.56 KB
/
container_run.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
#!/usr/bin/env bash
#
# This script starts up the Obscuro Gateway
#
# Ensure any fail is loud and explicit
set -euo pipefail
# Define defaults
port=3000
portWS=3001
host="0.0.0.0"
nodeHost="erpc.sepolia-testnet.ten.xyz"
nodePortHTTP=80
nodePortWS=81
logPath="wallet_extension_logs.txt"
databasePath=".obscuro/gateway_database.db"
image="obscuronet/obscuro_gateway_sepolia_testnet:latest"
# Parse the options
for argument in "$@"
do
key=$(echo $argument | cut -f1 -d=)
value=$(echo $argument | cut -f2 -d=)
case "$key" in
--host) host=${value} ;;
--port) port=${value} ;;
--portWS) portWS=${value} ;;
--nodeHost) nodeHost=${value} ;;
--nodePortHTTP) nodePortHTTP=${value} ;;
--nodePortWS) nodePortWS=${value} ;;
--logPath) logPath=${value} ;;
--databasePath) databasePath=${value} ;;
--image) image=${value} ;;
*)
esac
done
# Stop and remove any running container, and then start
echo "Force stopping any existing container ... "
docker rm -f obscuro_gateway_testnet 2>/dev/null
echo "Starting Obscuro Gateway..."
docker run -p 3000:"${port}" --name=obscuro_gateway_testnet \
--detach \
--network=node_network \
--entrypoint ./wallet_extension_linux \
"${image}" \
-host="${host}" -port="${port}" -portWS="${portWS}" -nodeHost="${nodeHost}" -nodePortHTTP="${nodePortHTTP}" \
-nodePortWS="${nodePortWS}" -logPath="${logPath}" -databasePath="${databasePath}"