forked from solana-labs/cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keygen.sh
executable file
·47 lines (39 loc) · 1.22 KB
/
keygen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
source env.sh
mkdir -p "$CLUSTER"
keygen() {
declare cmd=$*
solana-keygen --version
for zone in "${VALIDATOR_ZONES[@]}"; do
test -f "$CLUSTER"/validator-identity-"$zone".json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/validator-identity-"$zone".json)
test -f "$CLUSTER"/validator-vote-account-"$zone".json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/validator-vote-account-"$zone".json)
test -f "$CLUSTER"/validator-stake-account-"$zone".json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/validator-stake-account-"$zone".json)
done
if [[ -n $FAUCET_KEYPAIR ]]; then
test -f "$CLUSTER"/faucet.json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/faucet.json)
fi
test -f "$CLUSTER"/api-identity.json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/api-identity.json)
for zone in "${WAREHOUSE_ZONES[@]}"; do
test -f "$CLUSTER"/warehouse-identity-"$zone".json ||
(set -x; solana-keygen $cmd --outfile "$CLUSTER"/warehouse-identity-"$zone".json)
done
}
case "$1" in
recover)
keygen recover
;;
'')
keygen new --no-passphrase
;;
*)
echo "Error: unknown argument: -$1-"
exit 1
;;
esac