From fe3bd03234de641a8a3504c46312c7eb6245cb6d Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 21 Sep 2023 00:26:56 +0000 Subject: [PATCH] Fix local testnet to generate keys in the correct folders (#4752) Fix local testnet to generate keys in the correct folders when `BN_COUNT` and `VC_COUNT` don't match. The current script place the generated validator keys in validator folders based on the `BN_COUNT` config, e.g. `node_1/validators`, `node_2/validators`..etc. We should be using `VC_COUNT` here instead, otherwise the number of validator clients may not match the number of directories generated, and would result in either: 1. a VC not having any keys (when `BN_COUNT` < `VC_COUNT`) 2. a validator key directory not being used (when `BN_COUNT` > `VC_COUNT`). --- scripts/local_testnet/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local_testnet/setup.sh b/scripts/local_testnet/setup.sh index 283aa0c02..e026ba1c0 100755 --- a/scripts/local_testnet/setup.sh +++ b/scripts/local_testnet/setup.sh @@ -46,6 +46,6 @@ lcli \ insecure-validators \ --count $VALIDATOR_COUNT \ --base-dir $DATADIR \ - --node-count $BN_COUNT + --node-count $VC_COUNT echo Validators generated with keystore passwords at $DATADIR.