From 873a5c80ee1451bfa2d4e7433bb0953900030956 Mon Sep 17 00:00:00 2001 From: "Nita Neou (Soph)" Date: Tue, 10 Sep 2024 13:44:20 +0700 Subject: [PATCH 1/2] run stable localnet with external node --- Makefile | 8 +++++++- test/configs/local-resharding-with-external.txt | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4dbcf61cde..ce00f80d08 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,13 @@ debug-kill: bash ./test/kill_node.sh debug-ext: - bash ./test/debug-external.sh + # update localnet block per epoch to ensure a stable localnet + sed -i 's/localnetBlocksPerEpoch\s*=\s*[0-9]*/localnetBlocksPerEpoch = 64/' internal/configs/sharding/localnet.go + sed -i 's/localnetBlocksPerEpochV2\s*=\s*[0-9]*/localnetBlocksPerEpochV2 = 64/' internal/configs/sharding/localnet.go + bash ./test/debug-external.sh & + echo sleep 10s before creating the external validator + sleep 10 + bash ./test/build-localnet-validator.sh clean: rm -rf ./tmp_log* diff --git a/test/configs/local-resharding-with-external.txt b/test/configs/local-resharding-with-external.txt index 318a08b9bc..bb12da4c49 100644 --- a/test/configs/local-resharding-with-external.txt +++ b/test/configs/local-resharding-with-external.txt @@ -13,7 +13,7 @@ # fn node 127.0.0.1 9050 validator .hmy/52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d.key 127.0.0.1 9052 validator .hmy/678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c.key -#127.0.0.1 9054 validator .hmy/16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714.key +# 127.0.0.1 9054 validator .hmy/16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714.key # explorer node 127.0.0.1 9098 explorer null 0 @@ -32,6 +32,6 @@ # fn node 127.0.0.1 9150 validator .hmy/a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100.key 127.0.0.1 9152 validator .hmy/63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512.key -#127.0.0.1 9154 validator .hmy/576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90.key +# 127.0.0.1 9154 validator .hmy/576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90.key # explorer node 127.0.0.1 9096 explorer null 1 From 9f0467cd2edc72a8f8000258fea1367addeb8499 Mon Sep 17 00:00:00 2001 From: "Nita Neou (Soph)" Date: Tue, 10 Sep 2024 18:12:05 +0700 Subject: [PATCH 2/2] improve comment detection in deploy.sh --- test/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/deploy.sh b/test/deploy.sh index a87514b689..470a4b4f13 100755 --- a/test/deploy.sh +++ b/test/deploy.sh @@ -83,7 +83,7 @@ function launch_localnet() { # Read config for i-th node form config file IFS=' ' read -r ip port mode bls_key shard node_config <<<"${line}" args=("${base_args[@]}" --ip "${ip}" --port "${port}" --key "/tmp/${ip}-${port}.key" --db_dir "${ROOT}/db-${ip}-${port}" "--broadcast_invalid_tx=false") - if [[ -z "$ip" || -z "$port" || "$ip" == "#" ]]; then + if [[ -z "$ip" || -z "$port" || "${ip:0:1}" == "#" ]]; then echo "skip empty line or node or comment" continue fi