-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbash-config
executable file
·75 lines (50 loc) · 1.66 KB
/
bash-config
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
#set -o nounset \
# -o errexit
set -e
function show_env {
env | sort | grep INFRA
}
function validate_env {
local ENV_NAME=$1;
local ENV_VALUE=$(printenv $1);
local EXIT_FUNCTION=$2;
local EXIT_VALUE=$3;
if [[ -z "$ENV_VALUE" ]]; then
echo "$ENV_NAME is empty";
$EXIT_FUNCTION $EXIT_VALUE;
fi
if [ "$ENV_VALUE" = false ]; then
echo "$ENV_NAME is disabled";
$EXIT_FUNCTION $EXIT_VALUE;
fi
return 0;
}
function validate_env_hard {
local ENV_NAME=$1;
validate_env $ENV_NAME exit 1;
}
function validate_env_soft {
local ENV_NAME=$1;
validate_env $ENV_NAME return 1;
}
export LOTUS_PATH="$INFRA_LOTUS_HOME/.lotus";
export LOTUS_CONFIG_SOURCE_PATH="$INFRA_LOTUS_HOME/config.toml";
export LOTUS_CONFIG_TARGET_PATH="$LOTUS_PATH/config.toml";
export KEYSTORE_SOURCE_DIR="/keystore";
export KEYSTORE_TARGET_DIR="$LOTUS_PATH/keystore";
export TOKEN_SOURCE_PATH="$KEYSTORE_SOURCE_DIR/token";
export TOKEN_TARGET_PATH="$LOTUS_PATH/token";
export PRIVATE_KEY_SOURCE_PATH="$KEYSTORE_SOURCE_DIR/privatekey";
export PRIVATE_KEY_TARGET_PATH="$KEYSTORE_TARGET_DIR/MF2XI2BNNJ3XILLQOJUXMYLUMU";
export NODE_ID_SOURCE_PATH="$KEYSTORE_SOURCE_DIR/nodeid";
export NODE_ID_TARGET_PATH="$KEYSTORE_TARGET_DIR/NRUWE4BSOAWWQ33TOQ";
export SNAPSHOT_DEFAULT_PATH="/chain/chain.car";
export DATASTORE_TARGET_PATH="$LOTUS_PATH/datastore";
export IMPORT_COMPLETE_PATH="$LOTUS_PATH/import-complete";
export SYNC_COMPLETE_PATH="$LOTUS_PATH/sync-complete";
if [[ -z "$INFRA_LOTUS_GW_LOOKBACK_LIMIT" ]]; then
export INFRA_LOTUS_GW_LOOKBACK_LIMIT="2000";
fi
if [[ -z "$INFRA_LOTUS_GW_MAX_LOOKBACK" ]]; then
export INFRA_LOTUS_GW_MAX_LOOKBACK="16h40m0s";
fi