Add loopd

This commit is contained in:
Taylor Helsper 2020-02-08 20:20:35 -06:00
parent 5d00c8d86c
commit 5ab15413b7
10 changed files with 108 additions and 10 deletions

View File

@ -1,3 +1,8 @@
=== v0.1.87 ===
- Roll back tor update
- Add Lightning Loop v0.4.0
- Improve mempoolspace consistency
=== v0.1.86 ===
- Upgrade tor to v4.2.5
- Fix boot issue for VMs that don't have USB

View File

@ -3,6 +3,7 @@
/var/log/flask
/var/log/lndhub.log
/var/log/lnd.log
/var/log/loopd.log
/var/log/lnd_backup.log
/var/log/lnd_admin.log
/var/log/mynode.log

View File

@ -0,0 +1,2 @@
if $programname == 'loopd' then /var/log/loopd.log
& stop

View File

@ -1,26 +1,26 @@
# LND Admin service
# /etc/systemd/system/admin_admin.service
# loopd service
# /etc/systemd/system/loopd.service
[Unit]
Description=LND Admin
Wants=bitcoind.service
After=bitcoind.service
Description=loopd
Wants=lnd.service
After=lnd.service
[Service]
ExecStartPre=/usr/bin/wait_on_lnd.sh
WorkingDirectory=/opt/mynode/lnd-admin
ExecStart=/usr/bin/npm start
ExecStart=loopd
User=bitcoin
Group=bitcoin
Type=simple
KillMode=process
LimitNOFILE=128000
TimeoutSec=240
Restart=always
RestartSec=60
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=lnd_admin
SyslogIdentifier=loopd
[Install]
WantedBy=multi-user.target

View File

@ -28,6 +28,8 @@ while [ 1 ]; do
CURRENT=$(cat $WEBSSH2_UPGRADE_URL_FILE)
fi
if [ "$CURRENT" != "$WEBSSH2_UPGRADE_URL" ]; then
docker rmi webssh2 || true
cd /opt/mynode
rm -rf webssh2
wget $WEBSSH2_UPGRADE_URL -O webssh2.tar.gz

View File

@ -26,12 +26,12 @@ while true; do
# Copy LND files to admin folder
cp -f $LND_TLS_CERT_FILE /home/admin/.lnd/
cp -f $LND_ADMIN_MACAROON_FILE /home/admin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
cp -f /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/*.macaroon /home/admin/.lnd/data/chain/bitcoin/mainnet/
chown -R admin:admin /home/admin/.lnd/
echo "Updated admin copy of LND files!"
# Wait for changes
inotifywait -e modify -e create -e delete $LND_TLS_CERT_FILE $LND_ADMIN_MACAROON_FILE
inotifywait -e modify -e create -e delete $LND_TLS_CERT_FILE /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/*.macaroon
done
# Should never exit

View File

@ -50,6 +50,7 @@ curl https://keybase.io/roasbeef/pgp_keys.asc | gpg --import
curl https://raw.githubusercontent.com/JoinMarket-Org/joinmarket-clientserver/master/pubkeys/AdamGibson.asc | gpg --import
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964
curl https://keybase.io/suheb/pgp_keys.asc | gpg --import
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E #loopd
set -e
# Install docker
@ -162,6 +163,45 @@ if [ "$CURRENT" != "$LND_UPGRADE_URL" ]; then
fi
fi
# Upgrade Loopd
echo "Upgrading loopd..."
LOOP_VERSION="v0.4.0-beta"
LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
fi
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
LOOP_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.loop_url
LOOP_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt
LOOP_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt.sig
CURRENT=""
if [ -f $LOOP_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LOOP_UPGRADE_URL_FILE)
fi
if [ "$CURRENT" != "$LOOP_UPGRADE_URL" ]; then
# Download and install Loop
rm -rf /opt/download
mkdir -p /opt/download
cd /opt/download
wget $LOOP_UPGRADE_URL
wget $LOOP_UPGRADE_MANIFEST_URL
wget $LOOP_UPGRADE_MANIFEST_SIG_URL
gpg --verify manifest-*.txt.sig
if [ $? == 0 ]; then
# Install Loop
tar -xzf loop-*.tar.gz
mv $LOOP_ARCH-$LOOP_VERSION loop
install -m 0755 -o root -g root -t /usr/local/bin loop/*
# Mark current version
echo $LOOP_UPGRADE_URL > $LOOP_UPGRADE_URL_FILE
else
echo "ERROR UPGRADING LND - GPG FAILED"
fi
fi
# Install LndHub
LNDHUB_VERSION="v1.1.3"
LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/${LNDHUB_VERSION}.tar.gz
@ -388,6 +428,7 @@ systemctl enable glances
systemctl enable netdata
systemctl enable webssh2
systemctl enable tor
systemctl enable loopd
# Disable any old services
systemctl disable hitch

View File

@ -17,6 +17,8 @@ if [ "$APP" = "bitcoin" ]; then
rm -f /home/bitcoin/.mynode/.btc_url
elif [ "$APP" = "lnd" ]; then
rm -f /home/bitcoin/.mynode/.lnd_url
elif [ "$APP" = "loopd" ]; then
rm -f /home/bitcoin/.mynode/.loop_url
elif [ "$APP" = "lndhub" ]; then
rm -f /home/bitcoin/.mynode/.lndhub_url
elif [ "$APP" = "rtl" ]; then
@ -35,6 +37,8 @@ elif [ "$APP" = "lndconnect" ]; then
rm -f /home/bitcoin/.mynode/.lndconnect_url
elif [ "$APP" = "webssh2" ]; then
rm -f /mnt/hdd/mynode/settings/webssh2_url
systemctl stop webssh2
docker rmi webssh2
else
echo "UNKNOWN APP: $APP"
exit 1

View File

@ -817,6 +817,7 @@
<option value="none" selected="selected">Choose...</option>
<option value="bitcoin">Bitcoin</option>
<option value="lnd">LND</option>
<option value="loopd">Loop</option>
<option value="btcrpcexplorer">BTC RPC Explorer</option>
<option value="joinmarket">JoinMarket</option>
<option value="lndconnect">LND Connect</option>

View File

@ -126,6 +126,7 @@ curl https://keybase.io/roasbeef/pgp_keys.asc | gpg --import
curl https://raw.githubusercontent.com/JoinMarket-Org/joinmarket-clientserver/master/pubkeys/AdamGibson.asc | gpg --import
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964
curl https://keybase.io/suheb/pgp_keys.asc | gpg --import
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E #loopd
# Update python3 to 3.7.X
PYTHON3_VERSION=$(python3 --version)
@ -276,6 +277,46 @@ if [ "$CURRENT" != "$LND_UPGRADE_URL" ]; then
fi
cd ~
# Install Loopd
echo "Upgrading loopd..."
LOOP_VERSION="v0.4.0-beta"
LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
fi
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
LOOP_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.loop_url
LOOP_UPGRADE_MANIFEST_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt
LOOP_UPGRADE_MANIFEST_SIG_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/manifest-$LOOP_VERSION.txt.sig
CURRENT=""
if [ -f $LOOP_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $LOOP_UPGRADE_URL_FILE)
fi
if [ "$CURRENT" != "$LOOP_UPGRADE_URL" ]; then
# Download and install Loop
rm -rf /opt/download
mkdir -p /opt/download
cd /opt/download
wget $LOOP_UPGRADE_URL
wget $LOOP_UPGRADE_MANIFEST_URL
wget $LOOP_UPGRADE_MANIFEST_SIG_URL
gpg --verify manifest-*.txt.sig
if [ $? == 0 ]; then
# Install Loop
tar -xzf loop-*.tar.gz
mv $LOOP_ARCH-$LOOP_VERSION loop
install -m 0755 -o root -g root -t /usr/local/bin loop/*
# Mark current version
echo $LOOP_UPGRADE_URL > $LOOP_UPGRADE_URL_FILE
else
echo "ERROR UPGRADING LND - GPG FAILED"
fi
fi
# Setup "install" location for some apps
mkdir -p /opt/mynode
chown -R bitcoin:bitcoin /opt/mynode
@ -495,6 +536,7 @@ systemctl enable www
systemctl enable drive_check
systemctl enable bitcoind
systemctl enable lnd
systemctl enable loopd
systemctl enable lnd_unlock
systemctl enable lnd_backup
systemctl enable lnd_admin_files