ligo/scripts/launch-sandboxed-node.sh
Grégoire Henry d6348c009a Scripts/Test: more shared scripts...
- introduced `test/utils/test_lib.inc.sh` to simplify usage of
  sandboxed node/client in the testsuite

- it reuses code from `./script/{node,client}_lib.inc.sh`

- use `wait_for_the_node_to_be_ready` to properly wait for the node to
  be launched rather to use a fexed delay

- `test_multinode.sh` now launch 8 nodes.
2017-08-29 14:10:40 +02:00

28 lines
569 B
Bash
Executable File

#! /usr/bin/env bash
set -e
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")"
cd "$src_dir"
source $script_dir/node_lib.inc.sh
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...
cleanup_nodes
}
trap cleanup EXIT INT
start_sandboxed_node "$@"
wait $node_pids