Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Validators now request an airdrop of 1 token before starting up
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jul 13, 2018
1 parent 18e6ff4 commit 8e7a2a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions multinode-demo/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ if [[ ! -f "$SOLANA_LEADER_CONFIG_DIR"/ledger.log &&
"$SOLANA_LEADER_CONFIG_DIR"/tx-*.log) > "$SOLANA_LEADER_CONFIG_DIR"/ledger.log
fi

# Ensure the validator has at least 1 token before connecting to the network
# TODO: Remove this workaround
while ! $solana_wallet \
-l "$SOLANA_CONFIG_CLIENT_DIR"/leader.json \
-k "$SOLANA_CONFIG_PRIVATE_DIR"/id.json airdrop --tokens 1; do
sleep 1
done

# shellcheck disable=SC2086 # $program should not be quoted
exec $program \
--identity "$SOLANA_CONFIG_DIR"/validator.json \
Expand Down
8 changes: 4 additions & 4 deletions multinode-demo/wallet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ if [[ ! -r "$SOLANA_CONFIG_CLIENT_DIR"/leader.json ]]; then
)
fi

client_json="$SOLANA_CONFIG_CLIENT_DIR"/client.json
if [[ ! -r $client_json ]]; then
$solana_keygen -o "$client_json"
client_id_path="$SOLANA_CONFIG_CLIENT_DIR"/id.json
if [[ ! -r $client_id_path ]]; then
$solana_keygen -o "$client_id_path"
fi

set -x
# shellcheck disable=SC2086 # $solana_wallet should not be quoted
exec $solana_wallet \
-l "$SOLANA_CONFIG_CLIENT_DIR"/leader.json -k "$client_json" "$@"
-l "$SOLANA_CONFIG_CLIENT_DIR"/leader.json -k "$client_id_path" "$@"

0 comments on commit 8e7a2a9

Please sign in to comment.