-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial work on LTC * Support for BTC * BTC progress * Final updates for bitcoin * configure fix
- Loading branch information
Showing
12 changed files
with
237 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/sh | ||
|
||
DAEMON_FILE=/etc/icryptonode/daemon/bitcoin/bin/bitcoind | ||
DAEMON_CLI_FILE=/etc/icryptonode/daemon/bitcoin/bin/bitcoin-cli | ||
BLOCKCHAIN_DIR=/mnt/bitcoin/blockchain | ||
|
||
LOG_FILE=/mnt/bitcoin/blockchain/debug.log | ||
LOG_ROWS="200" | ||
|
||
DAEMON_ENABLED="$(uci get icryptonode.@info[0].daemon_enabled)" | ||
|
||
DAEMON_USER="$(uci get icryptonode.@info[0].daemon_user)" | ||
DAEMON_PASS="$(uci get icryptonode.@info[0].daemon_pass)" | ||
DAEMON_RPC_PORT="$(uci get icryptonode.@info[0].daemon_rpc_port)" | ||
|
||
CMD="$1" | ||
|
||
bitcoin_stop () { | ||
PIDOF=$(ps aux | egrep bitcoind.-daemon | egrep -v grep | awk '{print $2}') | ||
if [ -n "$PIDOF" ]; then | ||
echo "Stopping bitcoin (PID = $PIDOF)" | ||
$DAEMON_CLI_FILE -rpcuser=$DAEMON_USER -rpcpassword=$DAEMON_PASS -rpcport=$DAEMON_RPC_PORT stop | ||
fi | ||
} | ||
|
||
bitcoin_start () { | ||
|
||
if [ "$DAEMON_ENABLED" = "no" ]; then | ||
echo "DAEMON_ENABLED = no, not starting bitcoin" | ||
exit 1 | ||
fi | ||
echo "Starting bitcoin" | ||
$DAEMON_FILE -daemon -debuglogfile=$LOG_FILE -datadir=$BLOCKCHAIN_DIR -dbcache=128 -maxmempool=128 -mempoolexpiry=24 -disablewallet -noonion -debug=1 -shrinkdebugfile -rest -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcuser=$DAEMON_USER -rpcpassword=$DAEMON_PASS -rpcport=$DAEMON_RPC_PORT -server | ||
} | ||
|
||
bitcoin_restart () { | ||
bitcoin_stop | ||
sleep 6 | ||
bitcoin_start | ||
} | ||
|
||
if [ "$CMD" = "logs" ]; then | ||
|
||
tail -n"$LOG_ROWS" "$LOG_FILE" | ||
|
||
elif [ "$CMD" = "status" ]; then | ||
|
||
PIDOF=$(ps aux | egrep bitcoind.-daemon | egrep -v grep | awk '{print $2}') | ||
|
||
if [ -n "$PIDOF" ]; then | ||
echo "Bitcoin running (PIDOF = $PIDOF)" | ||
exit 5 | ||
else | ||
exit 4 | ||
fi | ||
|
||
elif [ "$CMD" = "stop" ]; then | ||
|
||
bitcoin_stop | ||
exit 0 | ||
|
||
elif [ "$CMD" = "start" ]; then | ||
|
||
bitcoin_start | ||
exit 0 | ||
|
||
elif [ "$CMD" = "restart" ]; then | ||
|
||
bitcoin_restart | ||
exit 0 | ||
|
||
elif [ "$CMD" = "version" ]; then | ||
|
||
$DAEMON_FILE -version | ||
|
||
else | ||
exit 9 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/sh | ||
|
||
DAEMON_FILE=/etc/icryptonode/daemon/litecoin/bin/litecoind | ||
DAEMON_CLI_FILE=/etc/icryptonode/daemon/litecoin/bin/litecoin-cli | ||
BLOCKCHAIN_DIR=/etc/icryptonode/blockchain | ||
|
||
LOG_FILE=/etc/icryptonode/blockchain/debug.log | ||
LOG_ROWS="200" | ||
|
||
DAEMON_ENABLED="$(uci get icryptonode.@info[0].daemon_enabled)" | ||
|
||
DAEMON_USER="$(uci get icryptonode.@info[0].daemon_user)" | ||
DAEMON_PASS="$(uci get icryptonode.@info[0].daemon_pass)" | ||
DAEMON_RPC_PORT="$(uci get icryptonode.@info[0].daemon_rpc_port)" | ||
|
||
CMD="$1" | ||
|
||
litecoin_stop () { | ||
PIDOF=$(ps aux | egrep litecoind.-daemon | egrep -v grep | awk '{print $2}') | ||
if [ -n "$PIDOF" ]; then | ||
echo "Stopping litecoin (PID = $PIDOF)" | ||
$DAEMON_CLI_FILE -rpcuser=$DAEMON_USER -rpcpassword=$DAEMON_PASS -rpcport=$DAEMON_RPC_PORT stop | ||
fi | ||
} | ||
|
||
litecoin_start () { | ||
|
||
if [ "$DAEMON_ENABLED" = "no" ]; then | ||
echo "DAEMON_ENABLED = no, not starting litecoin" | ||
exit 1 | ||
fi | ||
echo "Starting litecoin" | ||
$DAEMON_FILE -daemon -debuglogfile=$LOG_FILE -datadir=$BLOCKCHAIN_DIR -debug=1 -shrinkdebugfile -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcuser=$DAEMON_USER -rpcpassword=$DAEMON_PASS -rpcport=$DAEMON_RPC_PORT -server | ||
} | ||
|
||
litecoin_restart () { | ||
litecoin_stop | ||
sleep 6 | ||
litecoin_start | ||
} | ||
|
||
if [ "$CMD" = "logs" ]; then | ||
|
||
tail -n"$LOG_ROWS" "$LOG_FILE" | ||
|
||
elif [ "$CMD" = "status" ]; then | ||
|
||
PIDOF=$(ps aux | egrep litecoind.-daemon | egrep -v grep | awk '{print $2}') | ||
|
||
if [ -n "$PIDOF" ]; then | ||
echo "Litecoin running (PIDOF = $PIDOF)" | ||
exit 5 | ||
else | ||
exit 4 | ||
fi | ||
|
||
elif [ "$CMD" = "stop" ]; then | ||
|
||
litecoin_stop | ||
exit 0 | ||
|
||
elif [ "$CMD" = "start" ]; then | ||
|
||
litecoin_start | ||
exit 0 | ||
|
||
elif [ "$CMD" = "restart" ]; then | ||
|
||
litecoin_restart | ||
exit 0 | ||
|
||
elif [ "$CMD" = "version" ]; then | ||
|
||
$DAEMON_FILE -version | ||
|
||
else | ||
exit 9 | ||
fi | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# Cleans out old folder, extracts the new daemon, ensures perms are correct | ||
sudo rm -rf /etc/icryptonode/daemon/* | ||
|
||
# Pass in path to compressed daemon | ||
tar -xjf $1 -C /etc/icryptonode/daemon/ | ||
if [[ $1 = *.tar.bz2 ]]; then | ||
tar -xjf $1 -C /etc/icryptonode/daemon/ | ||
|
||
elif [[ $1 = *.tar.gz ]]; then | ||
tar -xzf $1 -C /etc/icryptonode/daemon/ | ||
|
||
fi | ||
|
||
sudo chown -R www-data:www-data /etc/icryptonode/daemon/* |
Oops, something went wrong.