lotus/scripts/docker-lotus-entrypoint.sh

23 lines
582 B
Bash
Raw Permalink Normal View History

2021-06-21 19:48:07 +00:00
#!/usr/bin/env bash
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
/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
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 $@