2021-06-21 19:48:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-19 15:56:12 +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-01-19 15:56:12 +00:00
|
|
|
/usr/local/bin/lotus daemon \
|
|
|
|
--import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" \
|
|
|
|
--remove-existing-chain=false \
|
|
|
|
--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
|
2024-01-19 15:56:12 +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
|
|
|
|
|
|
|
|
exec /usr/local/bin/lotus $@
|