-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathlaunch
executable file
·49 lines (37 loc) · 1.21 KB
/
launch
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
#!/usr/bin/env bash
. /etc/lotus/docker/bash-config
# Start the daemon process
function launch_daemon {
echo "Starting lotus daemon...";
lotus daemon;
}
function launch_daemon_follower {
lotus daemon --follower;
}
function launch_gateway {
launch_daemon &
echo "Starting lotus gateway...";
lotus wait-api --timeout 30m && lotus-gateway run --api-wait-lookback-limit $INFRA_LOTUS_GW_LOOKBACK_LIMIT --api-max-lookback $INFRA_LOTUS_GW_MAX_LOOKBACK;
}
function launch_follower {
launch_daemon_follower &
echo "Starting lotus follower...";
lotus wait-api --timeout 30m && lotus-gateway run --api-wait-lookback-limit $INFRA_LOTUS_GW_LOOKBACK_LIMIT --api-max-lookback $INFRA_LOTUS_GW_MAX_LOOKBACK;
}
function launch_daemon_lite {
echo "Starting lotus daemon in lite mode...";
lotus daemon --lite;
}
# Launch lotus in the selected mode
function launch {
if [ "$INFRA_LOTUS_FOLLOWER" = true ]; then
launch_follower;
elif [ "$INFRA_LOTUS_LITE" = true ]; then
validate_env_hard FULLNODE_API_INFO && launch_daemon_lite || echo "FULLNODE_API_INFO is invalid";
elif [ "$INFRA_LOTUS_GATEWAY" = true ]; then
launch_gateway;
elif [ "$INFRA_LOTUS_DAEMON" = true ]; then
launch_daemon;
fi
}
launch;