storj/cmd/storagenode/entrypoint
2019-04-08 16:01:20 -04:00

25 lines
700 B
Bash
Executable File

#!/bin/sh
set -euo pipefail
if [[ ! -f "${IDENT_PATH}/identity.key" ]]; then
cd /tmp
wget https://storj-v3-alpha-builds.storage.googleapis.com/e82d336-go1.11/identity_linux_${GOARCH}.zip
unzip identity_linux_${GOARCH}.zip
mv identity_linux_${GOARCH} identity
/tmp/identity create --difficulty ${CERT_DIFFICULTY:-30} storagenode
fi
if [[ ! -f "${CONF_PATH}/config.yaml" ]]; then
./storagenode setup
fi
RUN_PARAMS="${RUN_PARAMS:-} --config-dir ${CONF_PATH}"
export STORJ_SERVER_ADDRESS="${STORJ_SERVER_ADDRESS:-$(hostname -i):28967}"
if [ -n "${SATELLITE_ADDR:-}" ]; then
RUN_PARAMS="${RUN_PARAMS} --kademlia.bootstrap-addr $SATELLITE_ADDR"
fi
exec ./storagenode run $RUN_PARAMS "$@"