42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/bin/bash -e
|
|
|
|
echo Stopping daemons
|
|
snapctl stop --disable solana.daemon-drone
|
|
snapctl stop --disable solana.daemon-leader
|
|
snapctl stop --disable solana.daemon-validator
|
|
snapctl stop --disable solana.daemon-oom-monitor
|
|
snapctl stop --disable solana.daemon-net-stats
|
|
|
|
mode="$(snapctl get mode)"
|
|
if [[ -z "$mode" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
num_tokens="$(snapctl get num-tokens)"
|
|
num_tokens="${num_tokens:+-n $num_tokens}"
|
|
|
|
setup_args="$(snapctl get setup-args)"
|
|
|
|
case $mode in
|
|
leader+drone)
|
|
"$SNAP"/multinode-demo/setup.sh -t leader $num_tokens -p $setup_args
|
|
snapctl start --enable solana.daemon-drone
|
|
snapctl start --enable solana.daemon-leader
|
|
;;
|
|
leader)
|
|
"$SNAP"/multinode-demo/setup.sh -t leader $num_tokens -p $setup_args
|
|
snapctl start --enable solana.daemon-leader
|
|
;;
|
|
validator)
|
|
"$SNAP"/multinode-demo/setup.sh -t validator -p $setup_args
|
|
snapctl start --enable solana.daemon-validator
|
|
;;
|
|
*)
|
|
echo "Error: Unknown mode: $mode"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
snapctl start --enable solana.daemon-oom-monitor
|
|
snapctl start --enable solana.daemon-net-stats
|