From acee1701d5f9fbc3a9168996a4c1fec1c4c1faef Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Tue, 26 Mar 2019 10:33:15 -0700 Subject: [PATCH] Make deploy_newnode.sh autodetect bootnode This is done by reading bootnode address from the newest bootnode log file in tmp_log. --- test/deploy_newnode.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/deploy_newnode.sh b/test/deploy_newnode.sh index e47c3e2d0..efd586fe6 100755 --- a/test/deploy_newnode.sh +++ b/test/deploy_newnode.sh @@ -116,6 +116,25 @@ HMY_OPT= HMY_OPT2= HMY_OPT3= +unset -v latest_bootnode_log +latest_bootnode_log=$(ls -tr "${ROOT}"/tmp_log/log-*/bootnode.log | tail -1) +case "${latest_bootnode_log}" in +"") + echo "cannot determine latest bootnode log" + exit 69 + ;; +esac +unset -v bn_ma +bn_ma=$(sed -n 's:^.*BN_MA=::p' "${latest_bootnode_log}" | tail -1) +case "${bn_ma}" in +"") + echo "cannot determine boot node address from ${latest_bootnode_log}" + exit 69 + ;; +esac +echo "autodetected boot node multiaddr: ${bn_ma}" +HMY_OPT2="-bootnodes ${bn_ma}" + for i in 0{1..9} {10..99} do echo "launching new node $i ..."