/
validate.sh
79 lines (68 loc) 路 2.64 KB
/
validate.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
if [ -n "$withValidatorMnemonic" ] && [ -n "$withValidatorKeystore" ]
then
echo "Only of of --withValidatorMnemonic or --withValidatorKeystore options should be provided, exiting..."
exit;
fi
if [ -n "$withValidatorMnemonic" ]
then
if [ "$DEVNET_NAME" == "mainnet" ]
then
echo "withValidatorMnemonic is not safe to use on mainnet, please use withValidatorKeystore with correctly set LODESTAR_VALIDATOR_KEYSTORE_ARGS, exiting..."
exit;
fi;
withValidator="withValidatorMnemonic";
validatorKeyArgs="$LODESTAR_VALIDATOR_MNEMONIC_ARGS"
if [ ! -n "$validatorKeyArgs" ]
then
echo "To run validator with mnemonic, you need to set LODESTAR_VALIDATOR_MNEMONIC_ARGS, exiting..."
exit;
fi;
fi;
if [ -n "$withValidatorKeystore" ]
then
withValidator="withValidatorKeystore";
validatorKeyArgs="$LODESTAR_VALIDATOR_KEYSTORE_ARGS"
if [ ! -n "$validatorKeyArgs" ]
then
echo "To run validator with keystores, you need to set LODESTAR_VALIDATOR_KEYSTORE_ARGS, exiting ..."
exit;
fi;
fi;
if [ -n "$justVC" ] && [ ! -n "$withValidator" ]
then
echo "To run validator, you need to provide either one of --withValidatorMnemonic or --withValidatorKeystore, exiting..."
exit;
fi;
echo "withValidator = $withValidator, $validatorKeyArgs"
echo "detached = $detached"
if [ -n "$withTerminal" ] && [ -n "$detached" ]
then
echo "Only of of --withTerminal or --detached options should be provided, exiting..."
exit;
fi
if [ -n "$withValidator" ] && ( [ -n "$justEL" ] || [ -n "$justEL" ] || [ -n "$justEL" ] )
then
echo "--withValidator can not be just with --justEL or --justCL or --justVC. Try using only --justVC, exiting..."
exit;
fi;
if [ -n "$justEL" ] && ( [ -n "$justCL" ] || [ -n "$justVC" ] ) || [ -n "$justCL" ] && ( [ -n "$justEL" ] || [ -n "$justVC" ] ) || [ -n "$justVC" ] && ( [ -n "$justEL" ] || [ -n "$justCL" ] )
then
echo "only one of --justEL, --justCL or --justVC can be used at a time. You can however start another (parallel) run(s) to spin them up separately, exiting..."
exit;
fi
if [ ! -n "$dataDir" ]
then
echo "Please provide a data directory. If you are running fresh, the dataDir should be non existant for setup to configure it properly, exiting...";
exit;
fi;
if [ -n "$justCL" ] && [ -n "$justVC" ] && ([ "$elClient" != "geth" ] && [ "$elClient" != "nethermind" ] && [ "$elClient" != "ethereumjs" ] && [ "$elClient" != "besu" ])
then
echo "To run EL client you need to provide one of --elClient <geth | nethermind | ethereumjs | besu>, exiting ...";
exit;
fi
if [ ! -n "$JWT_SECRET" ]
then
echo "You need to provide a file containing 32 bytes JWT_SECRET in hex format, exiting ..."
exit;
fi;