Skip to content

Commit

Permalink
net.sh: Skip validator accounts creation if primordial
Browse files Browse the repository at this point in the history
  • Loading branch information
t-nelson committed Sep 11, 2020
1 parent 33abd11 commit ff88c96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions multinode-demo/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ wallet() {
setup_validator_accounts() {
declare node_sol=$1

if [[ -n "$SKIP_ACCOUNTS_CREATION" ]]; then
return 0
fi

if ! wallet vote-account "$vote_account"; then
if ((airdrops_enabled)); then
echo "Adding $node_sol to validator identity account:"
Expand Down
9 changes: 8 additions & 1 deletion net/remote/remote-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,14 @@ EOF
args+=(--init-complete-file "$initCompleteFile")
# shellcheck disable=SC2206 # Don't want to double quote $extraNodeArgs
args+=($extraNodeArgs)

maybeSkipAccountsCreation=
if [[ $nodeIndex -le $extraPrimordialStakes ]]; then
maybeSkipAccountsCreation="export SKIP_ACCOUNTS_CREATION=1"
fi

cat >> ~/solana/on-reboot <<EOF
$maybeSkipAccountsCreation
nohup multinode-demo/validator.sh ${args[@]} > validator.log.\$now 2>&1 &
pid=\$!
oom_score_adj "\$pid" 1000
Expand All @@ -397,7 +404,7 @@ EOF
net/remote/remote-node-wait-init.sh 600
fi

if [[ $skipSetup != true && $nodeType != blockstreamer ]]; then
if [[ $skipSetup != true && $nodeType != blockstreamer && -z $maybeSkipAccountsCreation ]]; then
# Wait for the validator to catch up to the bootstrap validator before
# delegating stake to it
solana --url http://"$entrypointIp":8899 catchup config/validator-identity.json
Expand Down

0 comments on commit ff88c96

Please sign in to comment.