forked from hyperledger-labs/splice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-canton.sh
More file actions
executable file
·34 lines (25 loc) · 1.13 KB
/
stop-canton.sh
File metadata and controls
executable file
·34 lines (25 loc) · 1.13 KB
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
#!/usr/bin/env bash
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -eou pipefail
source util.sh
POSTGRES_MODE=${1:-docker}
tmux_session="canton"
if tmux has-session -t=$tmux_session 2>/dev/null; then
# kill-session seems to send a SIGHUP which does not seem to be quite enough
echo "Killing canton tmux session"
# to tear down the processes promptly so we manually kill them.
# parents will usually be some shell process.
readarray -t TMUX_PARENT_PIDS < <(tmux list-panes -s -F "#{pane_pid}" -t $tmux_session)
kill_process_tree "${TMUX_PARENT_PIDS[@]}"
# Session might be dead at this point because we killed all processes
# but to be on the safe side we still kill it.
tmux kill-session -t $tmux_session 2>/dev/null || true
fi
rm -f canton.tokens canton-simtime.tokens
rm -f canton.participants canton-simtime.participants
echo "Stopping cometbft"
./scripts/cometbft.sh stop
echo "Stopping postgres"
./scripts/postgres.sh "$POSTGRES_MODE" stop
docker compose -f "$SPLICE_ROOT"/build-tools/observability/opentelemetry-collector.yml down