diff --git a/bin/lamassu-update b/bin/lamassu-update deleted file mode 100755 index b415a7ae..00000000 --- a/bin/lamassu-update +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -e - -export LOG_FILE=/tmp/update.$(date +"%Y%m%d").log -export NPM_BIN=$(npm -g bin) - -SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" - -rm -f ${LOG_FILE} - -decho () { - echo `date +"%H:%M:%S"` $1 - echo `date +"%H:%M:%S"` $1 >> ${LOG_FILE} -} - -cat <<'FIG' - _ -| | __ _ _ __ ___ __ _ ___ ___ _ _ ___ ___ _ ____ _____ _ __ -| |/ _` | '_ ` _ \ / _` / __/ __| | | |_____/ __|/ _ \ '__\ \ / / _ \ '__| -| | (_| | | | | | | (_| \__ \__ \ |_| |_____\__ \ __/ | \ V / __/ | -|_|\__,_|_| |_| |_|\__,_|___/___/\__,_| |___/\___|_| \_/ \___|_| -FIG - -echo -e "\nStarting \033[1mlamassu-server\033[0m update. This will take a few minutes...\n" - -if [ "$(whoami)" != "root" ]; then - echo -e "This script has to be run as \033[1mroot\033[0m user" - exit 3 -fi - -# Use a lock file so failed scripts cannot be imediately retried -# If not the backup created on this script would be replaced -if ! mkdir /var/lock/lamassu-update; then - echo "Script is locked because of a failure." >&2 - exit 1 -fi - -decho "stopping lamassu-server" -supervisorctl stop lamassu-server >> ${LOG_FILE} 2>&1 -supervisorctl stop lamassu-admin-server >> ${LOG_FILE} 2>&1 - -decho "unlinking ${NPM_BIN}/lamassu* old executables" -find ${NPM_BIN} -type l \( -name "lamassu-*" -or -name "hkdf" \) -exec rm -fv {} \; >> ${LOG_FILE} 2>&1 - -if [ -d "/usr/lib/node_modules/lamassu-server" ]; then - BKP_NAME=lamassu-server-$(date +%s) - decho "renaming old lamassu-server instance to ${BKP_NAME}" - mv -v "/usr/lib/node_modules/lamassu-server" "/usr/lib/node_modules/${BKP_NAME}" >> ${LOG_FILE} 2>&1 -fi - -decho "updating node" -npm install n -g >> ${LOG_FILE} 2>&1 -n 8 >> ${LOG_FILE} 2>&1 -decho "version installed $(node -v)" -export NPM_BIN=$(npm -g bin) - -decho "updating lamassu-server#dev" -npm -g install lamassu/lamassu-server#dev --unsafe-perm >> ${LOG_FILE} 2>&1 - -decho "rebuilding npm deps" -cd $(npm root -g)/lamassu-server/ >> ${LOG_FILE} 2>&1 -npm rebuild >> ${LOG_FILE} 2>&1 - -{ -decho "running migration" - lamassu-migrate >> ${LOG_FILE} 2>&1 -} || { echo "Failure running migrations" ; exit 1 ; } - -lamassu-migrate-config >> ${LOG_FILE} 2>&1 - -decho "update to mnemonic" -lamassu-update-to-mnemonic --prod >> ${LOG_FILE} 2>&1 - -decho "update configure frontcamera" -lamassu-configure-frontcamera >> ${LOG_FILE} 2>&1 - -decho "update ofac sources" -lamassu-ofac-update-sources >> ${LOG_FILE} 2>&1 - -decho "updating supervisor conf" -perl -i -pe 's/command=.*/command=$ENV{NPM_BIN}\/lamassu-server/g' /etc/supervisor/conf.d/lamassu-server.conf >> ${LOG_FILE} 2>&1 -perl -i -pe 's/command=.*/command=$ENV{NPM_BIN}\/lamassu-admin-server/g' /etc/supervisor/conf.d/lamassu-admin-server.conf >> ${LOG_FILE} 2>&1 - -decho "updating lamassu-server" -supervisorctl update lamassu-server >> ${LOG_FILE} 2>&1 -supervisorctl update lamassu-admin-server >> ${LOG_FILE} 2>&1 -supervisorctl start lamassu-server >> ${LOG_FILE} 2>&1 -supervisorctl start lamassu-admin-server >> ${LOG_FILE} 2>&1 - -decho "updating backups conf" -BACKUP_CMD=${NPM_BIN}/lamassu-backup-pg -BACKUP_CRON="@daily $BACKUP_CMD > /dev/null" -( (crontab -l 2>/dev/null || echo -n "") | grep -v '@daily.*lamassu-backup-pg'; echo $BACKUP_CRON ) | crontab - >> $LOG_FILE 2>&1 -$BACKUP_CMD >> $LOG_FILE 2>&1 - -decho "updating motd scripts" -set +e -chmod -x /etc/update-motd.d/*-release-upgrade -chmod -x /etc/update-motd.d/*-updates-available -chmod -x /etc/update-motd.d/*-reboot-required -chmod -x /etc/update-motd.d/*-help-text -chmod -x /etc/update-motd.d/*-cloudguest -set -e - -# reset terminal to link new executables -hash -r - -rm -r /var/lock/lamassu-update - -decho "Update complete!" diff --git a/lib/blockchain/bitcoin.js b/lib/blockchain/bitcoin.js index cfad370b..78c95ba1 100644 --- a/lib/blockchain/bitcoin.js +++ b/lib/blockchain/bitcoin.js @@ -24,5 +24,6 @@ server=1 connections=40 keypool=10000 prune=4000 -daemon=0` +daemon=0 +addresstype=p2sh-segwit` } diff --git a/lib/blockchain/litecoin.js b/lib/blockchain/litecoin.js index 2e1d4ea2..ac716295 100644 --- a/lib/blockchain/litecoin.js +++ b/lib/blockchain/litecoin.js @@ -24,5 +24,6 @@ server=1 connections=40 keypool=10000 prune=4000 -daemon=0` +daemon=0 +addresstype=p2sh-segwit` } diff --git a/package.json b/package.json index 6d32cbac..c2d5a1b4 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "lamassu-cancel": "./bin/lamassu-cancel", "lamassu-nuke-db": "./bin/lamassu-nuke-db", "lamassu-coins": "./bin/lamassu-coins", - "lamassu-update": "./bin/lamassu-update", "lamassu-ofac-update": "./bin/lamassu-ofac-update", "lamassu-send-coins": "./bin/lamassu-send-coins", "lamassu-update-to-mnemonic": "./bin/lamassu-update-to-mnemonic",