#! /usr/bin/env bash set -e node_dirs=() node_pids=() start_sandboxed_node() { id=$1 max_peer_id=${max_peer_id:-9} shift 1 port=$((19730 + id)) rpc=$((18730 + id)) expected_pow="${expected_pow:-0.0}" expected_connections="${expected_connections:-3}" node_dir="$(mktemp -d -t tezos-node.XXXXXXXX)" peers=("--no-bootstrap-peers") for peer_port in $(seq 19730 $((19730 + max_peer_id))); do peers+=("--peer") peers+=("127.0.0.1:$peer_port") done peers+=("--private-mode") node="${local_node}" sandbox_param="--sandbox=$sandbox_file" if ! [ -f "$sandbox_file" ]; then cat > "$sandbox_file" < "${node_dir}/tezos.crt" < "${node_dir}/tezos.key" <" echo " where 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 } if [ "$0" == "$BASH_SOURCE" ]; then main "$@" fi