-
Notifications
You must be signed in to change notification settings - Fork 3
/
up-generic.sh
executable file
·50 lines (40 loc) · 1.07 KB
/
up-generic.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
: ${TRIPLET:=x86_64-linux-gnu}
: ${bitcoind=5}
: ${lnd=1}
: ${tor=1}
$(which python3) plebnet_generate.py TRIPLET=$TRIPLET bitcoind=$bitcoind lnd=$lnd tor=$tor
#Remove
docker-compose down
sudo rm -rf volumes
#Create Datafile
mkdir volumes
for (( i=0; i<=$bitcoind-1; i++ ))
do
mkdir -p volumes/bitcoin_datadir_$i
done
for (( i=0; i<=$lnd-1; i++ ))
do
mkdir -p volumes/lnd_datadir_$i
done
rm -rf volumes/tor_*dir_*
for (( i=0; i<=$tor-1; i++ ))
do
mkdir -p volumes/tor_datadir_$i
mkdir -p volumes/tor_servicesdir_$i
mkdir -p volumes/tor_torrcdir_$i
done
#REF: https://docs.docker.com/engine/install/linux-postinstall
while ! docker system info > /dev/null 2>&1; do
echo "Waiting for docker to start..."
if [[ "$(uname -s)" == "Linux" ]]; then
systemctl restart docker.service
fi
if [[ "$(uname -s)" == "Darwin" ]]; then
open --background -a /./Applications/Docker.app/Contents/MacOS/Docker
fi
sleep 1;
done
ARCH=$(uname -m)
export ARCH
docker-compose build --build-arg TRIPLET=$TRIPLET
docker-compose up --remove-orphans -d