Запуск демона Bitcoin Core
Аналогично для Litecoin Core Daemon
Bash:
#!/bin/bash
PATH="bin/bitcoind"
SLEEP_CMD="/bin/sleep"
GREP_CMD="/bin/grep"
PS_CMD="/bin/ps"
ARGS=(
"-datadir=/root/bitcoin-core/bitcoin-storage"
"-dbcache=450"
"-prune=600"
"-debug=validation"
"-daemon"
# "-reindex"
# "-reindex-chainstate"
)
while true; do
if ! "$PS_CMD" aux | "$GREP_CMD" -v grep | "$GREP_CMD" -q "$PATH"; then
echo "Start bitcoind..."
"$PATH" "${ARGS[@]}"
fi
"$SLEEP_CMD" 10
done
Аналогично для Litecoin Core Daemon
Bash:
#!/bin/bash
PATH="bin/litecoind"
SLEEP_CMD="/bin/sleep"
GREP_CMD="/bin/grep"
PS_CMD="/bin/ps"
ARGS=(
"-datadir=/root/bitcoin-core/bitcoin-storage"
"-dbcache=450"
"-prune=600"
# "-debug=validation"
"-daemon"
# "-reindex"
# "-reindex-chainstate"
)
while true; do
if ! "$PS_CMD" aux | "$GREP_CMD" -v grep | "$GREP_CMD" -q "$PATH"; then
echo "Start litecoind..."
"$PATH" "${ARGS[@]}"
fi
"$SLEEP_CMD" 10
done