-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun
executable file
·56 lines (48 loc) · 1.81 KB
/
run
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
#!/bin/sh
# set it to somewhere in the home
src=/var/lib/sawroom
touch $src/.keep || return 1
# if test "$src" = "."; then
# src=$(pwd)
# fi
ID=$(id -ru)
OWNIP=$(hostname -I | awk '{print $1}')
mkdir -p "$src"/data
mkdir -p "$src"/keys/sawtooth "$src"/keys/tor
mkdir -p "$src"/log/sawtooth "$src"/log/tor
t="$src"/log/tor/dam-client.log && touch "$t"
t="$src"/log/tor/dam-dir.log && touch "$t"
t="$src"/log/tor/tor.log && touch "$t"
# --mount type=bind,source="$src"/keys/tor,destination=/etc/tor \
cat <<EOF
___ ___ _____ ___ ___ __ __
/ __| /_\ \ / / _ \/ _ \ / _ \| \/ |
\__ \/ _ \ \/\/ /| / (_) | (_) | |\/| |
|___/_/ \_\_/\_/ |_|_\\___/ \___/|_| |_|
Started full node, process control via supervisorctl
Execute ./shell to step into the running container
Hit Ctrl-C to stop
EOF
if [ "$1" = "" ]; then
docker run -it \
--mount type=bind,source="$src"/data,destination=/var/lib/sawtooth \
--mount type=bind,source="$src"/keys/sawtooth,destination=/etc/sawtooth/keys \
--mount type=bind,source="$src"/keys/tor,destination=/var/lib/tor \
--mount type=bind,source="$src"/log/sawtooth,destination=/var/log/sawtooth \
--mount type=bind,source="$src"/log/tor,destination=/var/log/tor \
-p 8008:8008 \
-p 9009:9009 \
-p 8800:8800 \
dyne/sawroom:testnet sawroom-start $ID $OWNIP
else
docker run -it \
--mount type=bind,source="$src"/data,destination=/var/lib/sawtooth \
--mount type=bind,source="$src"/keys/sawtooth,destination=/etc/sawtooth/keys \
--mount type=bind,source="$src"/keys/tor,destination=/var/lib/tor \
--mount type=bind,source="$src"/log/sawtooth,destination=/var/log/sawtooth \
--mount type=bind,source="$src"/log/tor,destination=/var/log/tor \
-p 8008:8008 \
-p 9009:9009 \
-p 8800:8800 \
dyne/sawroom:testnet $*
fi