-
Notifications
You must be signed in to change notification settings - Fork 9
/
stop.sh
executable file
·52 lines (44 loc) · 1.23 KB
/
stop.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
#!/bin/bash
set -uex
source ./common.sh
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
EXCHANGE_DIR=$DIR/dingir-exchange
STATE_MNGR_DIR=$DIR/rollup-state-manager
FAUCET_DIR=$DIR/regnbue-bridge
ORCHESTRA_DIR=$DIR/orchestra
BLOCKSCOUT_DIR=$DIR/blockscout
echo "DX_CLEAN: $DX_CLEAN"
function kill_tasks() {
# kill last time running tasks:
ps aux | grep 'fluidex-backend' | grep -v grep | awk '{print $2 " " $11}'
kill -9 $(ps aux | grep 'fluidex-backend' | grep -v grep | awk '{print $2}') || true
# tick.ts
# matchengine
# rollup_state_manager
# coordinator
# prover
}
function stop_docker_compose() {
dir=$1
name=$2
docker-compose --file $dir/docker/docker-compose.yaml --project-name $name down --remove-orphans
if [ $DX_CLEAN == 'TRUE' ]; then
docker_rm -rf $dir/docker/data
docker_rm -rf $dir/docker/volumes
fi
}
function stop_docker_composes() {
stop_docker_compose $ORCHESTRA_DIR orchestra
stop_docker_compose $FAUCET_DIR faucet
stop_docker_compose $BLOCKSCOUT_DIR blockscout
}
function clean_data() {
rm -rf rollup-state-manager/circuits/testdata/persist/
rm -rf contracts/ganache
}
kill_tasks
stop_docker_composes
if [ $DX_CLEAN == 'TRUE' ]; then
clean_data
fi
unset DIRTY