Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Joinmarket GUI #606

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions rootfs/standard/etc/systemd/system/jmg.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# JoinMarket GUI service
# /etc/systemd/system/jmg.service

[Unit]
Description=JMG
Wants=bitcoin.service
After=bitcoin.service

[Service]
ExecStartPre=/usr/bin/is_not_shutting_down.sh
ExecStartPre=/usr/bin/is_mainnet.sh
WorkingDirectory=/home/joinmarket/jmg
ExecStart=/bin/sh -c 'cd /home/joinmarket/jmg && ./jmg_venv/bin/python src/app.py'

User=joinmarket
Group=joinmarket
Type=simple
TimeoutSec=120
Restart=always
RestartSec=30
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=jmg

[Install]
WantedBy=multi-user.target
26 changes: 26 additions & 0 deletions rootfs/standard/etc/systemd/system/jmwalletd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# JoinMarket Wallet service
# /etc/systemd/system/jmwalletd.service

[Unit]
Description=JoinMarketWallet
Wants=bitcoin.service
After=bitcoin.service

[Service]
ExecStartPre=/usr/bin/is_not_shutting_down.sh
ExecStartPre=/usr/bin/is_mainnet.sh
WorkingDirectory=/home/joinmarket/joinmarket-clientserver
ExecStart=/bin/sh -c 'cd /home/joinmarket/joinmarket-clientserver && ./jmvenv/bin/python scripts/jmwalletd.py'

User=joinmarket
Group=joinmarket
Type=simple
TimeoutSec=120
Restart=always
RestartSec=30
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=jmwalletd

[Install]
WantedBy=multi-user.target
34 changes: 34 additions & 0 deletions rootfs/standard/usr/bin/mynode_post_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,40 @@ if should_install_app "joininbox" ; then
fi
fi

# Install JoinMarket GUI
if should_install_app "jm"; then
manasgandy marked this conversation as resolved.
Show resolved Hide resolved
if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then
JMG_UPGRADE_URL=https://github.com/manasgandy/joinmarket-gui/archive/refs/tags/%JMG_VERSION.tar.gz
manasgandy marked this conversation as resolved.
Show resolved Hide resolved
CURRENT=""
if [ -f $JMG_VERSION_FILE ]; then
CURRENT=$(cat $JMG_VERSION_FILE)
fi
if [ "$CURRENT" != "$JMG_VERSION" ]; then
# Download and build JoinMarket GUI
cd /home/joinmarket

# Delete previous version
rm -rf jmg

sudo -u joinmarket wget $JMG_UPGRADE_URL -O jmg.tar.gz
sudo -u joinmarket tar -xvf jmg.tar.gz
sudo -u joinmarket rm jm.tar.gz
mv jmg-* jmg
cd jmg

# Install dependencies
sudo -u joinmarket python3 -m venv jmg_venv
sudo -u joinmarket ./jmg_venv/bin/pip install -r requirements.txt

# Setup TLS certificates
sudo -u joinmarket mkdir .joinmarket/ssl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be a way to re-use an existing cert. I'll need to think about this more.

sudo -u joinmarket openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -batch -out /home/joinmarket/.joinmarket/ssl/cert.pem -keyout /home/joinmarket/.joinmarket/ssl/key.pem

echo $JMG_VERSION > $JMG_VERSION_FILE
fi
fi
fi

# Install Whirlpool
if should_install_app "whirlpool" ; then
WHIRLPOOL_UPGRADE_URL=https://code.samourai.io/whirlpool/whirlpool-client-cli/uploads/$WHIRLPOOL_UPLOAD_FILE_ID/whirlpool-client-cli-$WHIRLPOOL_VERSION-run.jar
Expand Down
2 changes: 2 additions & 0 deletions rootfs/standard/usr/bin/mynode_uninstall_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ elif [ "$APP" = "joininbox" ]; then
rm -rf /home/joinmarket/*
rm -rf /home/joinmarket/joininbox-*
rm -rf /home/joinmarket/.cache
elif [ "$APP" = "jmg" ]; then
rm -rf /home/joinmarket/jmg
manasgandy marked this conversation as resolved.
Show resolved Hide resolved
elif [ "$APP" = "lndhub" ]; then
rm -rf /opt/mynode/LndHub
elif [ "$APP" = "lndmanage" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ echo $CARAVAN_VERSION > $CARAVAN_LATEST_VERSION_FILE
echo $CORSPROXY_VERSION > $CORSPROXY_LATEST_VERSION_FILE
echo $JOINMARKET_VERSION > $JOINMARKET_LATEST_VERSION_FILE
echo $JOININBOX_VERSION > $JOININBOX_LATEST_VERSION_FILE
echo $JMG_VERSION > $JMG_LATEST_VERSION_FILE
echo $SECP256K1_VERSION > $SECP256K1_LATEST_VERSION_FILE
echo $WHIRLPOOL_VERSION > $WHIRLPOOL_LATEST_VERSION_FILE
echo $DOJO_VERSION > $DOJO_LATEST_VERSION_FILE
Expand Down
4 changes: 4 additions & 0 deletions rootfs/standard/usr/share/mynode/application_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,9 @@
"short_name": "ufw",
"show_on_application_page": false,
"journalctl_log_name": "ufw"
},
{
"name": "Joinmarket GUI",
"short_name": "jmg"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case there are issues, I think adding it as a "standalone" app that shows up on the application page may be better for users. Maybe follow a pattern similar to LNDConnect or Pool.

]
4 changes: 4 additions & 0 deletions rootfs/standard/usr/share/mynode/mynode_app_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ JOININBOX_VERSION="v0.6.4"
JOININBOX_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version
JOININBOX_LATEST_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version_latest

JMG_VERSION="v0.3.1-alpha"
JMG_VERSION=/home/bitcoin/.mynode/jmg_version
JMG_LATEST_VERSION_FILE=/home/bitcoin/.mynode/jmg_version_latest

SECP256K1_VERSION=486205aa68b7f1d4291f78fa20bc4485fd843e1c
SECP256K1_VERSION_FILE=/home/bitcoin/.mynode/secp256k1_version
SECP256K1_LATEST_VERSION_FILE=/home/bitcoin/.mynode/secp256k1_version_latest
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.