2021-06-21 19:48:07 +00:00
|
|
|
#!/usr/bin/env bash
|
2024-04-26 15:05:44 +00:00
|
|
|
|
2021-09-07 07:10:43 +00:00
|
|
|
if [ ! -z $DOCKER_LOTUS_IMPORT_SNAPSHOT ]; then
|
2021-06-21 19:48:07 +00:00
|
|
|
GATE="$LOTUS_PATH"/date_initialized
|
|
|
|
# Don't init if already initialized.
|
2021-06-22 15:59:43 +00:00
|
|
|
if [ ! -f "$GATE" ]; then
|
|
|
|
echo importing minimal snapshot
|
2024-04-26 15:03:57 +00:00
|
|
|
echo "yes" | /usr/local/bin/lotus daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
|
2021-06-22 15:59:43 +00:00
|
|
|
# Block future inits
|
|
|
|
date > "$GATE"
|
2021-06-21 19:48:07 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-06-22 15:59:43 +00:00
|
|
|
# import wallet, if provided
|
2021-09-07 07:10:43 +00:00
|
|
|
if [ ! -z $DOCKER_LOTUS_IMPORT_WALLET ]; then
|
2021-06-22 15:59:43 +00:00
|
|
|
/usr/local/bin/lotus-shed keyinfo import "$DOCKER_LOTUS_IMPORT_WALLET"
|
2021-06-21 19:48:07 +00:00
|
|
|
fi
|
|
|
|
|
2024-05-08 17:23:37 +00:00
|
|
|
exec /usr/local/bin/lotus daemon $@
|