Skip to content

Commit a07a440

Browse files
committed
Add validator_accounts_list.sh
1 parent 506bf49 commit a07a440

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,5 @@
111111
!tools/offline.txt
112112
!tools/setup-env.sh
113113
!tools/unseal.sh
114+
!tools/validator_accounts_list.sh
114115
!tools/withdraw.sh

tools/validator_accounts_list.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)