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

Add Check for Faucet Key Existence Before Building External Validator #4805

Merged
merged 2 commits into from
Dec 2, 2024
Merged
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
36 changes: 29 additions & 7 deletions test/build-localnet-validator.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#! /bin/bash

echo "Make sure the validator account are imported"
# The faucet address
FAUCET_ADDRESS="one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur"

# Get list of the current keys
KEYS_OUTPUT=$(hmy keys list)

# Check if the hmy executed successfully
if [ $? -ne 0 ]; then
echo "Error: Failed to execute 'hmy keys list'. Please ensure the hmy tool is installed and configured properly."
exit 1
fi

# Search for the faucet address in the output
# if the faucet account doesn't exist, show error
if echo "$KEYS_OUTPUT" | grep -q "$FAUCET_ADDRESS"; then
echo "The faucet account is set"
else
echo "validator creation failed, the faucet address '$FAUCET_ADDRESS' is not found"
echo "the keys location is: $(hmy keys location)"
echo "Make sure the faucet account are imported"
exit 1
fi

hmy keys import-ks .hmy/extkeystore/one17ughrllgnzx9sfa46p568k8rdmtz7qj85slc6t.key 2> /dev/null
hmy keys import-ks .hmy/extkeystore/one1auqndgthqu5lznsn7tuma8s5333cq0y07cwc6x.key 2> /dev/null
hmy keys import-ks .hmy/extkeystore/one19aw2wcr5y4lxeuwt0ajgt5aw3a3qkjdgg67ygj.key 2> /dev/null
Expand All @@ -9,12 +31,12 @@ hmy keys import-ks .hmy/extkeystore/one19zzwsxr0uf2fe34y8qkadek2v0eh6h5mg2deg6.k
hmy keys import-ks .hmy/extkeystore/one1lctumupg2y009pjmnhnmn4nqjk0zf0dspjanf7.key 2> /dev/null

echo "Let's fund all the validator account"
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one17ughrllgnzx9sfa46p568k8rdmtz7qj85slc6t --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one1auqndgthqu5lznsn7tuma8s5333cq0y07cwc6x --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one19aw2wcr5y4lxeuwt0ajgt5aw3a3qkjdgg67ygj --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one1eenp9ujcrmyaq22ef6jrpry2k97tjz4xs6ppcf --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one19zzwsxr0uf2fe34y8qkadek2v0eh6h5mg2deg6 --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --to one1lctumupg2y009pjmnhnmn4nqjk0zf0dspjanf7 --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one17ughrllgnzx9sfa46p568k8rdmtz7qj85slc6t --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one1auqndgthqu5lznsn7tuma8s5333cq0y07cwc6x --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one19aw2wcr5y4lxeuwt0ajgt5aw3a3qkjdgg67ygj --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one1eenp9ujcrmyaq22ef6jrpry2k97tjz4xs6ppcf --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one19zzwsxr0uf2fe34y8qkadek2v0eh6h5mg2deg6 --from-shard 0 --to-shard 0 --amount 110000
hmy --node=http://127.0.0.1:9500 transfer --from $FAUCET_ADDRESS --to one1lctumupg2y009pjmnhnmn4nqjk0zf0dspjanf7 --from-shard 0 --to-shard 0 --amount 110000


#wait for epoch 2
Expand Down