[cmd] fix node.sh and deploy.sh

pull/3278/head
Jacky Wang 4 years ago
parent a2bf359721
commit f79ce076fe
No known key found for this signature in database
GPG Key ID: 1085CE5F4FF5842C
  1. 19
      test/deploy.sh

@ -72,7 +72,7 @@ function launch_localnet() {
verbosity=3
fi
base_args=(-log_folder "${log_folder}" -min_peers "${MIN}" -bootnodes "${BN_MA}" "-network_type=$NETWORK" -blspass file:"${ROOT}/.hmy/blspass.txt" "-dns=false" "-verbosity=${verbosity}")
base_args=(--log_folder "${log_folder}" --min_peers "${MIN}" --bootnodes "${BN_MA}" "--network_type=$NETWORK" --blspass file:"${ROOT}/.hmy/blspass.txt" "--dns=false" "--verbosity=${verbosity}")
sleep 2
# Start nodes
@ -82,7 +82,7 @@ function launch_localnet() {
# Read config for i-th node form config file
IFS=' ' read -r ip port mode bls_key shard <<<"${line}"
args=("${base_args[@]}" -ip "${ip}" -port "${port}" -key "/tmp/${ip}-${port}.key" -db_dir "${ROOT}/db-${ip}-${port}" "-broadcast_invalid_tx=true")
args=("${base_args[@]}" --ip "${ip}" --port "${port}" --key "/tmp/${ip}-${port}.key" --db_dir "${ROOT}/db-${ip}-${port}" "--broadcast_invalid_tx=true")
if [[ -z "$ip" || -z "$port" ]]; then
echo "skip empty node"
continue
@ -90,11 +90,11 @@ function launch_localnet() {
# Setup BLS key for i-th localnet node
if [[ ! -e "$bls_key" ]]; then
args=("${args[@]}" -blskey_file "BLSKEY")
args=("${args[@]}" --blskey_file "BLSKEY")
elif [[ -f "$bls_key" ]]; then
args=("${args[@]}" -blskey_file "${ROOT}/${bls_key}")
args=("${args[@]}" --blskey_file "${ROOT}/${bls_key}")
elif [[ -d "$bls_key" ]]; then
args=("${args[@]}" -blsfolder "${ROOT}/${bls_key}")
args=("${args[@]}" --blsfolder "${ROOT}/${bls_key}")
else
echo "skipping unknown node"
continue
@ -103,16 +103,16 @@ function launch_localnet() {
# Setup flags for i-th node based on config
case "${mode}" in
explorer)
args=("${args[@]}" "-node_type=explorer" "-shard_id=${shard}")
args=("${args[@]}" "--node_type=explorer" "--shard_id=${shard}")
;;
archival)
args=("${args[@]}" -is_archival)
args=("${args[@]}" --is_archival "--staking=false")
;;
leader)
args=("${args[@]}" -is_leader)
args=("${args[@]}" --is_leader "--staking=false")
;;
external)
args=("${args[@]}" "-staking=true")
args=("${args[@]}" "--staking=true")
;;
client)
continue
@ -120,6 +120,7 @@ function launch_localnet() {
esac
# Start the node
echo "${args[@]}" "${extra_args[@]}"
${DRYRUN} "${ROOT}/bin/harmony" "${args[@]}" "${extra_args[@]}" 2>&1 | tee -a "${LOG_FILE}" &
done <"${config}"
}

Loading…
Cancel
Save