forked from make-software/casper-clarity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-dev.sh
46 lines (41 loc) · 1.11 KB
/
run-dev.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
## Work in Progress
# Build Clarity
yarn install &> /dev/null & # Install Clarity dependencies
install_pid=$!
echo "[YARN] Installing dependencies..."
wait $install_pid
yarn build &> /dev/null & # Build Clarity packages
build_pid=$!
echo "[YARN] Building packages..."
wait $build_pid
# Start NCTL network
nctl-compile &> /dev/null && # Compile node and prep NCTL
nctl-assets-setup &> /dev/null && # Create assets for local network
nctl-start &> /dev/null &
nctl_pid=$! # Start local 5 node network
echo "[NCTL] Network is live..."
wait $nctl_pid
# Start Event Store
cd packages/event_store &&
rm developement_sqlite.db &&
sleep 2
npm run start-web-server &> /dev/null &
web_server_pid=$!
echo "[WEB SERVER] Starting up..."
sleep 2
npm run start-event-handler &> /dev/null &
event_handler_pid=$!
echo "[EVENT HANDLER] Starting up..."
sleep 2
# Set process trap
trap onexit Int
function onexit() {
kill -9 $web_server_pid
kill -9 $event_handler_pid
nctl-assets-teardown
}
# Start Clarity
cd ../..
echo "[YARN] Starting Clarity..."
sleep 20
yarn dev &> /dev/null