|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# validator_accounts_list.sh |
| 4 | +# |
| 5 | +# Lists the validator account pubkeys and their on-chain indices. |
| 6 | + |
| 7 | +# -------------------------- HEADER ------------------------------------------- |
| 8 | + |
| 9 | +tools_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" |
| 10 | +source "$tools_dir/../src/common.sh" |
| 11 | +housekeeping |
| 12 | + |
| 13 | +# -------------------------- PRECONDITIONS ------------------------------------ |
| 14 | + |
| 15 | +assert_not_on_node_server |
| 16 | + |
| 17 | +reset_checks |
| 18 | +check_is_defined node_server_username |
| 19 | +check_is_defined node_server_hostname |
| 20 | +check_is_valid_port node_server_ssh_port |
| 21 | +check_is_valid_ethereum_network ethereum_network |
| 22 | +check_is_defined prysm_validator_bin |
| 23 | +check_is_defined prysm_validator_wallet_dir |
| 24 | +check_is_defined prysm_validator_wallet_password_file |
| 25 | +check_is_defined prysm_validator_user |
| 26 | +print_failed_checks --error |
| 27 | + |
| 28 | +# -------------------------- BANNER ------------------------------------------- |
| 29 | + |
| 30 | +# -------------------------- PREAMBLE ----------------------------------------- |
| 31 | + |
| 32 | +# -------------------------- RECONNAISSANCE ----------------------------------- |
| 33 | + |
| 34 | +node_server_ssh_endpoint="${node_server_username}@${node_server_hostname}" |
| 35 | + |
| 36 | +# -------------------------- EXECUTION ---------------------------------------- |
| 37 | + |
| 38 | +ssh -p "$node_server_ssh_port" "$node_server_ssh_endpoint" -t " |
| 39 | + # list the full pubkeys |
| 40 | + sudo -u '$prysm_validator_user' '$prysm_validator_bin' accounts list --accept-terms-of-use --${ethereum_network} --wallet-dir='$prysm_validator_wallet_dir' --wallet-password-file='$prysm_validator_wallet_password_file' 2>/dev/null |
| 41 | +
|
| 42 | + # list the indices on chain |
| 43 | + sudo -u '$prysm_validator_user' '$prysm_validator_bin' accounts list --accept-terms-of-use --${ethereum_network} --wallet-dir='$prysm_validator_wallet_dir' --wallet-password-file='$prysm_validator_wallet_password_file' --list-validator-indices 2>/dev/null |
| 44 | +" |
| 45 | + |
| 46 | +# -------------------------- POSTCONDITIONS ----------------------------------- |
0 commit comments