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