Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scripts for local testnet in multikey mode #5940

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/testnet/include/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ generateConfig() {

TMP_SHARD_OBSERVERCOUNT=$SHARD_OBSERVERCOUNT
TMP_META_OBSERVERCOUNT=$META_OBSERVERCOUNT
# set num of observers to 0, they will start with generated keys
if [[ $MULTI_KEY_NODES -eq 1 ]]; then
TMP_SHARD_OBSERVERCOUNT=0
TMP_META_OBSERVERCOUNT=0
Expand Down
10 changes: 9 additions & 1 deletion scripts/testnet/include/observers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@ assembleCommand_startObserverNode() {
let "KEY_INDEX=$TOTAL_NODECOUNT - $OBSERVER_INDEX - 1"
WORKING_DIR=$TESTNETDIR/node_working_dirs/observer$OBSERVER_INDEX

KEYS_FLAGS="-validator-key-pem-file ./config/validatorKey.pem -sk-index $KEY_INDEX"
# if node is running in multi key mode, in order to avoid loading the common allValidatorKeys.pem file
# and force generating a new key for observers, simply provide an invalid path
if [[ $MULTI_KEY_NODES -eq 1 ]]; then
TMP_MISSING_PEM="missing-file.pem"
KEYS_FLAGS="-all-validator-keys-pem-file $TMP_MISSING_PEM -validator-key-pem-file $TMP_MISSING_PEM"
fi

local nodeCommand="./node \
-port $PORT --profile-mode -log-save -log-level $LOGLEVEL --log-logger-name --log-correlation --use-health-service -rest-api-interface localhost:$RESTAPIPORT \
-destination-shard-as-observer $SHARD \
-sk-index $KEY_INDEX \
$KEYS_FLAGS \
-working-directory $WORKING_DIR -config ./config/config_observer.toml $EXTRA_OBSERVERS_FLAGS"

if [ -n "$NODE_NICENESS" ]
Expand Down
4 changes: 0 additions & 4 deletions scripts/testnet/variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ export TOTAL_OBSERVERCOUNT=$total_observer_count
# to enable the full archive feature on the observers, please use the --full-archive flag
export EXTRA_OBSERVERS_FLAGS="-operation-mode db-lookup-extension"

if [[ $MULTI_KEY_NODES -eq 1 ]]; then
EXTRA_OBSERVERS_FLAGS="--no-key"
fi

# Leave unchanged.
let "total_node_count = $SHARD_VALIDATORCOUNT * $SHARDCOUNT + $META_VALIDATORCOUNT + $TOTAL_OBSERVERCOUNT"
export TOTAL_NODECOUNT=$total_node_count
Expand Down
Loading