mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-13 17:09:15 +00:00
Make LndHub upgradable
This commit is contained in:
parent
4e26ed66e2
commit
f210d8f634
|
@ -1,3 +1,8 @@
|
||||||
|
=== v0.1.84 ===
|
||||||
|
- Fix issue copying files after an upgrade
|
||||||
|
- Add button to reset Whirlpool config
|
||||||
|
- Enable LndHub upgrades
|
||||||
|
|
||||||
=== v0.1.83 ===
|
=== v0.1.83 ===
|
||||||
- Revert 0.1.82
|
- Revert 0.1.82
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,32 @@ if [ "$CURRENT" != "$LND_UPGRADE_URL" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Install LndHub
|
||||||
|
LNDHUB_VERSION="v1.1.3"
|
||||||
|
LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/${LNDHUB_VERSION}.tar.gz
|
||||||
|
LNDHUB_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndhub_url
|
||||||
|
CURRENT=""
|
||||||
|
if [ -f $LNDHUB_UPGRADE_URL_FILE ]; then
|
||||||
|
CURRENT=$(cat $LNDHUB_UPGRADE_URL_FILE)
|
||||||
|
fi
|
||||||
|
if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
|
||||||
|
cd /opt/mynode
|
||||||
|
rm -rf LndHub
|
||||||
|
|
||||||
|
wget $LNDHUB_UPGRADE_URL
|
||||||
|
tar -xzf ${LNDHUB_VERSION}.tar.gz
|
||||||
|
rm -f ${LNDHUB_VERSION}.tar.gz
|
||||||
|
mv LndHub-* LndHub
|
||||||
|
chown -R bitcoin:bitcoin LndHub
|
||||||
|
|
||||||
|
cd LndHub
|
||||||
|
sudo -u bitcoin npm install --only=production
|
||||||
|
sudo -u bitcoin ln -s /home/bitcoin/.lnd/tls.cert tls.cert
|
||||||
|
sudo -u bitcoin ln -s /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon admin.macaroon
|
||||||
|
echo $LNDHUB_UPGRADE_URL > $LNDHUB_UPGRADE_URL_FILE
|
||||||
|
fi
|
||||||
|
cd ~
|
||||||
|
|
||||||
# Install recent version of secp256k1
|
# Install recent version of secp256k1
|
||||||
echo "Installing secp256k1..."
|
echo "Installing secp256k1..."
|
||||||
if [ ! -f /usr/include/secp256k1_ecdh.h ]; then
|
if [ ! -f /usr/include/secp256k1_ecdh.h ]; then
|
||||||
|
|
|
@ -17,6 +17,8 @@ if [ "$APP" = "bitcoin" ]; then
|
||||||
rm -f /home/bitcoin/.mynode/.btc_url
|
rm -f /home/bitcoin/.mynode/.btc_url
|
||||||
elif [ "$APP" = "lnd" ]; then
|
elif [ "$APP" = "lnd" ]; then
|
||||||
rm -f /home/bitcoin/.mynode/.lnd_url
|
rm -f /home/bitcoin/.mynode/.lnd_url
|
||||||
|
elif [ "$APP" = "lndhub" ]; then
|
||||||
|
rm -f /home/bitcoin/.mynode/.lndhub_url
|
||||||
elif [ "$APP" = "rtl" ]; then
|
elif [ "$APP" = "rtl" ]; then
|
||||||
rm -f /home/bitcoin/.mynode/.rtl_url
|
rm -f /home/bitcoin/.mynode/.rtl_url
|
||||||
elif [ "$APP" = "mempoolspace" ]; then
|
elif [ "$APP" = "mempoolspace" ]; then
|
||||||
|
|
|
@ -207,7 +207,9 @@ fi
|
||||||
# Update files that need RPC password (needed if upgrades overwrite files)
|
# Update files that need RPC password (needed if upgrades overwrite files)
|
||||||
PW=$(cat /mnt/hdd/mynode/settings/.btcrpcpw)
|
PW=$(cat /mnt/hdd/mynode/settings/.btcrpcpw)
|
||||||
if [ -f /opt/mynode/LndHub/config.js ]; then
|
if [ -f /opt/mynode/LndHub/config.js ]; then
|
||||||
|
cp -f /usr/share/mynode/lndhub-config.js /opt/mynode/LndHub/config.js
|
||||||
sed -i "s/mynode:.*@/mynode:$PW@/g" /opt/mynode/LndHub/config.js
|
sed -i "s/mynode:.*@/mynode:$PW@/g" /opt/mynode/LndHub/config.js
|
||||||
|
chown bitcoin:bitcoin /opt/mynode/LndHub/config.js
|
||||||
fi
|
fi
|
||||||
if [ -f /opt/mynode/btc-rpc-explorer/.env ]; then
|
if [ -f /opt/mynode/btc-rpc-explorer/.env ]; then
|
||||||
sed -i "s/BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=$PW/g" /opt/mynode/btc-rpc-explorer/.env
|
sed -i "s/BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=$PW/g" /opt/mynode/btc-rpc-explorer/.env
|
||||||
|
|
|
@ -708,6 +708,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<a href="/settings/reinstall-app?app=bitcoin" class="ui-button ui-widget ui-corner-all settings_button">Bitcoin</a>
|
<a href="/settings/reinstall-app?app=bitcoin" class="ui-button ui-widget ui-corner-all settings_button">Bitcoin</a>
|
||||||
<a href="/settings/reinstall-app?app=lnd" class="ui-button ui-widget ui-corner-all settings_button">LND</a>
|
<a href="/settings/reinstall-app?app=lnd" class="ui-button ui-widget ui-corner-all settings_button">LND</a>
|
||||||
|
<a href="/settings/reinstall-app?app=lndhub" class="ui-button ui-widget ui-corner-all settings_button">LndHub</a>
|
||||||
<a href="/settings/reinstall-app?app=rtl" class="ui-button ui-widget ui-corner-all settings_button">RTL</a>
|
<a href="/settings/reinstall-app?app=rtl" class="ui-button ui-widget ui-corner-all settings_button">RTL</a>
|
||||||
<a href="/settings/reinstall-app?app=mempoolspace" class="ui-button ui-widget ui-corner-all settings_button">Mempool.Space</a>
|
<a href="/settings/reinstall-app?app=mempoolspace" class="ui-button ui-widget ui-corner-all settings_button">Mempool.Space</a>
|
||||||
<a href="/settings/reinstall-app?app=joinmarket" class="ui-button ui-widget ui-corner-all settings_button">JoinMarket</a>
|
<a href="/settings/reinstall-app?app=joinmarket" class="ui-button ui-widget ui-corner-all settings_button">JoinMarket</a>
|
||||||
|
|
|
@ -20,6 +20,12 @@
|
||||||
<div class="info_tile_header">API Key for Whirlpool GUI</div>
|
<div class="info_tile_header">API Key for Whirlpool GUI</div>
|
||||||
<div class="info_tile_contents">{{whirlpool_api_key}}</div>
|
<div class="info_tile_contents">{{whirlpool_api_key}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="info_tile">
|
||||||
|
<div class="info_tile_header">Reset Config</div>
|
||||||
|
<div class="info_tile_contents">
|
||||||
|
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 70%;" href="/reset-whirlpool">Reset</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if whirlpool_enabled %}
|
{% if whirlpool_enabled %}
|
||||||
<div class="info_tile">
|
<div class="info_tile">
|
||||||
|
|
|
@ -58,3 +58,10 @@ def page_toggle_whirlpool():
|
||||||
check_logged_in()
|
check_logged_in()
|
||||||
os.system("systemctl restart whirlpool --no-pager")
|
os.system("systemctl restart whirlpool --no-pager")
|
||||||
return redirect("/whirlpool")
|
return redirect("/whirlpool")
|
||||||
|
|
||||||
|
@mynode_whirlpool.route("/reset-whirlpool")
|
||||||
|
def page_reset_whirlpool():
|
||||||
|
check_logged_in()
|
||||||
|
os.system("rm -f /opt/mynode/whirlpool/whirlpool-cli-config.properties")
|
||||||
|
os.system("systemctl restart whirlpool --no-pager")
|
||||||
|
return redirect("/whirlpool")
|
||||||
|
|
|
@ -281,16 +281,30 @@ chown -R bitcoin:bitcoin /opt/mynode
|
||||||
|
|
||||||
|
|
||||||
# Install LND Hub
|
# Install LND Hub
|
||||||
if [ ! -f /tmp/installed_lndhub ]; then
|
LNDHUB_VERSION="v1.1.3"
|
||||||
|
LNDHUB_UPGRADE_URL=https://github.com/BlueWallet/LndHub/archive/${LNDHUB_VERSION}.tar.gz
|
||||||
|
LNDHUB_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.lndhub_url
|
||||||
|
CURRENT=""
|
||||||
|
if [ -f $LNDHUB_UPGRADE_URL_FILE ]; then
|
||||||
|
CURRENT=$(cat $LNDHUB_UPGRADE_URL_FILE)
|
||||||
|
fi
|
||||||
|
if [ "$CURRENT" != "$LNDHUB_UPGRADE_URL" ]; then
|
||||||
cd /opt/mynode
|
cd /opt/mynode
|
||||||
rm -rf LndHub
|
rm -rf LndHub
|
||||||
sudo -u bitcoin git clone https://github.com/BlueWallet/LndHub.git
|
|
||||||
|
wget $LNDHUB_UPGRADE_URL
|
||||||
|
tar -xzf ${LNDHUB_VERSION}.tar.gz
|
||||||
|
rm -f ${LNDHUB_VERSION}.tar.gz
|
||||||
|
mv LndHub-* LndHub
|
||||||
|
chown -R bitcoin:bitcoin LndHub
|
||||||
|
|
||||||
cd LndHub
|
cd LndHub
|
||||||
sudo -u bitcoin npm install --only=production
|
sudo -u bitcoin npm install --only=production
|
||||||
sudo -u bitcoin ln -s /home/bitcoin/.lnd/tls.cert tls.cert
|
sudo -u bitcoin ln -s /home/bitcoin/.lnd/tls.cert tls.cert
|
||||||
sudo -u bitcoin ln -s /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon admin.macaroon
|
sudo -u bitcoin ln -s /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon admin.macaroon
|
||||||
touch /tmp/installed_lndhub
|
echo $LNDHUB_UPGRADE_URL > $LNDHUB_UPGRADE_URL_FILE
|
||||||
fi
|
fi
|
||||||
|
cd ~
|
||||||
|
|
||||||
# Install electrs (only build to save new version, now included in overlay)
|
# Install electrs (only build to save new version, now included in overlay)
|
||||||
#cd /home/admin/download
|
#cd /home/admin/download
|
||||||
|
|
Loading…
Reference in New Issue
Block a user