From b4e6018dd1d017105f72e1bc1f76688a25251e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 25 Feb 2019 15:44:25 +0100 Subject: [PATCH] P2p: do not use ipv4 discovery in sandboxed scripts (closes 477) This partially revert f51b8ad998b30670e54c066ede48494b7ccb4a90. We should way until a proper configuration-less discovery mechanism based on ipv6_multicast is re-enabled before to use it by default in the tests. --- src/bin_client/tezos-init-sandboxed-client.sh | 4 ++-- src/bin_node/tezos-sandboxed-node.sh | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bin_client/tezos-init-sandboxed-client.sh b/src/bin_client/tezos-init-sandboxed-client.sh index 52cd53f58..4250db669 100755 --- a/src/bin_client/tezos-init-sandboxed-client.sh +++ b/src/bin_client/tezos-init-sandboxed-client.sh @@ -169,7 +169,7 @@ usage() { echo "Small script to initialize a client to a local and closed test network with a maximum of 9 nodes." echo echo "Usage: eval \`$0 \`" - echo " where should be a positive integer." + echo " where should be an integer between 1 and 9." } main () { @@ -189,7 +189,7 @@ main () { local_compiler="${local_compiler:-$(which tezos-protocol-compiler)}" fi - if [ $# -lt 1 ] || [ "$1" -le 0 ] ; then + if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then usage exit 1 fi diff --git a/src/bin_node/tezos-sandboxed-node.sh b/src/bin_node/tezos-sandboxed-node.sh index e7487c5f5..0f1304778 100755 --- a/src/bin_node/tezos-sandboxed-node.sh +++ b/src/bin_node/tezos-sandboxed-node.sh @@ -17,8 +17,11 @@ start_sandboxed_node() { 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" @@ -38,7 +41,6 @@ EOF --data-dir "$node_dir" \ --net-addr "127.0.0.1:$port" \ --rpc-addr "127.0.0.1:$rpc" \ - --discovery-addr "127.255.255.255" \ --rpc-tls "${node_dir}/tezos.crt,${node_dir}/tezos.key" \ --expected-pow "$expected_pow" \ --connections "$expected_connections" @@ -167,7 +169,6 @@ EOF --data-dir "$node_dir" \ --net-addr "127.0.0.1:$port" \ --rpc-addr "127.0.0.1:$rpc" \ - --discovery-addr "127.255.255.255" \ --expected-pow "$expected_pow" \ --connections "$expected_connections" fi @@ -196,11 +197,11 @@ main() { sandbox_file="${sandbox_file:-sandbox.json}" fi - if [ $# -lt 1 ] || [ "$1" -le 0 ]; then + 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 " - echo " where should be a positive integer." + echo " where should be an integer between 1 and 9." exit 1 fi