[Linux] Start Bitcoin Core (& Analogs) Daemon script

  • Автор темы Автор темы reg1on
  • Дата начала Дата начала
Запуск демона Bitcoin Core

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
 
Назад
Сверху