add docker-compose file
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z DOCKER_LOTUS_IMPORT_SNAPSHOT ]; then
|
||||
GATE="$LOTUS_PATH"/date_initialized
|
||||
|
||||
# Don't init if already initialized.
|
||||
if [ -f "GATE" ]; then
|
||||
echo lotus already initialized.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo importing minimal snapshot
|
||||
/usr/local/bin/lotus daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
|
||||
|
||||
# Block future inits
|
||||
date > "$GATE"
|
||||
fi
|
||||
|
||||
if [ ! -z DOCKER_LOTUS_WALLET_IMPORT ]; then
|
||||
mkdir $LOTUS_PATH/keystore
|
||||
cp "${DOCKER_LOTUS_WALLET_IMPORT}" "${LOTUS_PATH}/keystore"
|
||||
fi
|
||||
|
||||
exec /usr/local/bin/lotus $@
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z DOCKER_LOTUS_MINER_INIT ]; then
|
||||
GATE="$LOTUS_PATH"/date_initialized
|
||||
|
||||
# Don't init if already initialized.
|
||||
if [ -f "GATE" ]; then
|
||||
echo lotus-miner already initialized.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo starting init
|
||||
/usr/local/bin/lotus-miner init
|
||||
|
||||
# Block future inits
|
||||
date > "$GATE"
|
||||
fi
|
||||
|
||||
exec /usr/local/bin/lotus-miner $@
|
||||
Reference in New Issue
Block a user