P2p: do not use ipv4 discovery in sandboxed scripts (closes 477)

This partially revert f51b8ad998.

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.
This commit is contained in:
Grégoire Henry 2019-02-25 15:44:25 +01:00 committed by Pierre Boutillier
parent 32348c092c
commit b4e6018dd1
2 changed files with 8 additions and 7 deletions

View File

@ -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 "Small script to initialize a client to a local and closed test network with a maximum of 9 nodes."
echo echo
echo "Usage: eval \`$0 <id>\`" echo "Usage: eval \`$0 <id>\`"
echo " where <id> should be a positive integer." echo " where <id> should be an integer between 1 and 9."
} }
main () { main () {
@ -189,7 +189,7 @@ main () {
local_compiler="${local_compiler:-$(which tezos-protocol-compiler)}" local_compiler="${local_compiler:-$(which tezos-protocol-compiler)}"
fi fi
if [ $# -lt 1 ] || [ "$1" -le 0 ] ; then if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
usage usage
exit 1 exit 1
fi fi

View File

@ -17,8 +17,11 @@ start_sandboxed_node() {
expected_connections="${expected_connections:-3}" expected_connections="${expected_connections:-3}"
node_dir="$(mktemp -d -t tezos-node.XXXXXXXX)" node_dir="$(mktemp -d -t tezos-node.XXXXXXXX)"
peers=("--no-bootstrap-peers") 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") peers+=("--private-mode")
node="${local_node}" node="${local_node}"
sandbox_param="--sandbox=$sandbox_file" sandbox_param="--sandbox=$sandbox_file"
@ -38,7 +41,6 @@ EOF
--data-dir "$node_dir" \ --data-dir "$node_dir" \
--net-addr "127.0.0.1:$port" \ --net-addr "127.0.0.1:$port" \
--rpc-addr "127.0.0.1:$rpc" \ --rpc-addr "127.0.0.1:$rpc" \
--discovery-addr "127.255.255.255" \
--rpc-tls "${node_dir}/tezos.crt,${node_dir}/tezos.key" \ --rpc-tls "${node_dir}/tezos.crt,${node_dir}/tezos.key" \
--expected-pow "$expected_pow" \ --expected-pow "$expected_pow" \
--connections "$expected_connections" --connections "$expected_connections"
@ -167,7 +169,6 @@ EOF
--data-dir "$node_dir" \ --data-dir "$node_dir" \
--net-addr "127.0.0.1:$port" \ --net-addr "127.0.0.1:$port" \
--rpc-addr "127.0.0.1:$rpc" \ --rpc-addr "127.0.0.1:$rpc" \
--discovery-addr "127.255.255.255" \
--expected-pow "$expected_pow" \ --expected-pow "$expected_pow" \
--connections "$expected_connections" --connections "$expected_connections"
fi fi
@ -196,11 +197,11 @@ main() {
sandbox_file="${sandbox_file:-sandbox.json}" sandbox_file="${sandbox_file:-sandbox.json}"
fi 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 "Small script to launch local and closed test network with a maximum of 9 nodes."
echo echo
echo "Usage: $0 <id>" echo "Usage: $0 <id>"
echo " where <id> should be a positive integer." echo " where <id> should be an integer between 1 and 9."
exit 1 exit 1
fi fi