2016-08-18 10:19:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-08-18 11:50:02 +00:00
|
|
|
export HOME="/var/lib/steemd"
|
2016-08-18 10:19:41 +00:00
|
|
|
|
2016-08-18 11:50:02 +00:00
|
|
|
chown -R steemd:steemd $HOME
|
|
|
|
|
|
|
|
SEED_NODES="
|
|
|
|
52.38.66.234:2001
|
|
|
|
52.37.169.52:2001
|
|
|
|
52.26.78.244:2001
|
|
|
|
192.99.4.226:2001
|
|
|
|
46.252.27.1:1337
|
|
|
|
81.89.101.133:2001
|
|
|
|
52.4.250.181:39705
|
|
|
|
steemd.pharesim.me:2001
|
|
|
|
seed.steemed.net:2001
|
|
|
|
steem.clawmap.com:2001
|
|
|
|
seed.steemwitness.com:2001
|
|
|
|
steem-seed1.abit-more.com:2001
|
|
|
|
"
|
2016-08-27 00:54:16 +00:00
|
|
|
|
2016-08-18 11:50:02 +00:00
|
|
|
ARGS=""
|
2016-08-27 00:54:16 +00:00
|
|
|
|
|
|
|
if [[ -z "$STEEMD_SEED_NODES" ]]; then
|
|
|
|
for NODE in $SEED_NODES ; do
|
|
|
|
ARGS+=" --seed-node=$NODE"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -z "$STEEMD_SEED_NODES" ]]; then
|
|
|
|
for NODE in $STEEMD_SEED_NODES ; do
|
|
|
|
ARGS+=" --seed-node=$NODE"
|
|
|
|
done
|
|
|
|
fi
|
2016-08-18 10:19:41 +00:00
|
|
|
|
2016-08-18 12:34:18 +00:00
|
|
|
if [[ ! -z "$STEEMD_WITNESS_NAME" ]]; then
|
|
|
|
ARGS+=" --witness=\"$STEEMD_WITNESS_NAME\""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -z "$STEEMD_MINER_NAME" ]]; then
|
|
|
|
ARGS+=" --miner=[\"$STEEMD_MINER_NAME\",\"$STEEMD_PRIVATE_KEY\"]"
|
2016-09-01 22:51:38 +00:00
|
|
|
ARGS+=" --mining-threads=$(nproc)"
|
2016-08-18 12:34:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -z "$STEEMD_PRIVATE_KEY" ]]; then
|
|
|
|
ARGS+=" --private-key=$STEEMD_PRIVATE_KEY"
|
|
|
|
fi
|
|
|
|
|
2016-08-18 12:11:25 +00:00
|
|
|
# without --data-dir it uses cwd as datadir(!)
|
|
|
|
# who knows what else it dumps into current dir
|
2016-08-18 11:50:02 +00:00
|
|
|
cd $HOME
|
2016-08-18 12:11:25 +00:00
|
|
|
|
2016-09-01 22:43:33 +00:00
|
|
|
# overwrite local config with image one
|
2016-09-01 23:04:51 +00:00
|
|
|
cp /etc/steemd/config.ini $HOME/config.ini
|
2016-09-01 22:43:33 +00:00
|
|
|
|
2016-09-02 03:03:19 +00:00
|
|
|
# if no blockchain in volume, use seed from image and verify
|
|
|
|
if [[ ! -d /var/lib/steemd/blockchain ]]; then
|
|
|
|
cd /var/lib/steemd
|
|
|
|
tar xvjpf /var/cache/steemd/blockchain.tbz2
|
|
|
|
chown -R steemd:steemd blockchain
|
|
|
|
ARGS+=" --replay-blockchain"
|
|
|
|
fi
|
|
|
|
|
2016-09-01 22:44:17 +00:00
|
|
|
# slow down restart loop if flapping
|
|
|
|
sleep 1
|
|
|
|
|
2016-08-18 12:03:02 +00:00
|
|
|
exec chpst -usteemd \
|
2016-08-18 11:50:02 +00:00
|
|
|
steemd \
|
|
|
|
--rpc-endpoint=0.0.0.0:8090 \
|
2016-08-18 12:03:02 +00:00
|
|
|
--p2p-endpoint=0.0.0.0:2001 \
|
2016-08-18 12:11:25 +00:00
|
|
|
--data-dir=$HOME \
|
2016-08-18 11:50:02 +00:00
|
|
|
$ARGS \
|
2016-08-18 10:19:41 +00:00
|
|
|
$STEEMD_EXTRA_OPTS \
|
2016-08-18 12:03:02 +00:00
|
|
|
2>&1
|