2017-08-28 20:34:36 +04:00
|
|
|
#! /usr/bin/env bash
|
2017-08-14 13:06:37 +04:00
|
|
|
|
2017-08-28 11:56:57 +04:00
|
|
|
set -e
|
2017-08-14 13:06:37 +04:00
|
|
|
|
|
|
|
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
|
2017-08-28 11:56:57 +04:00
|
|
|
src_dir="$(dirname "$script_dir")"
|
|
|
|
cd "$src_dir"
|
|
|
|
|
2017-08-28 20:34:36 +04:00
|
|
|
source $script_dir/node_lib.inc.sh
|
|
|
|
|
2017-08-28 11:56:57 +04:00
|
|
|
if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
|
|
|
|
echo "Small script to launch local and closed test network with a maximum of 9 nodes."
|
|
|
|
echo
|
|
|
|
echo "Usage: $0 <id>"
|
|
|
|
echo " where <id> should be an integer between 1 and 9."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cleanup () {
|
|
|
|
set +e
|
|
|
|
echo Cleaning up...
|
2017-08-28 20:34:36 +04:00
|
|
|
cleanup_nodes
|
2017-08-28 11:56:57 +04:00
|
|
|
}
|
|
|
|
trap cleanup EXIT INT
|
|
|
|
|
2017-08-28 20:34:36 +04:00
|
|
|
start_sandboxed_node "$@"
|
|
|
|
wait $node_pids
|