diff --git a/rootfs/standard/etc/systemd/system/poold.service b/rootfs/standard/etc/systemd/system/poold.service new file mode 100644 index 00000000..2e12e9cd --- /dev/null +++ b/rootfs/standard/etc/systemd/system/poold.service @@ -0,0 +1,26 @@ +# poold service +# /etc/systemd/system/poold.service + +[Unit] +Description=poold +Wants=lnd.service +After=lnd.service + +[Service] +ExecStartPre=/usr/bin/is_not_shutting_down.sh +ExecStartPre=/usr/bin/wait_on_lnd.sh +ExecStart=/usr/local/bin/poold --basedir=/mnt/hdd/mynode/pool + +User=bitcoin +Group=bitcoin +Type=simple +KillMode=control-group +TimeoutSec=240 +Restart=always +RestartSec=60 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=poold + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/rootfs/standard/etc/systemd/system/whirlpool.service b/rootfs/standard/etc/systemd/system/whirlpool.service index 3d6bd3eb..5293aec0 100644 --- a/rootfs/standard/etc/systemd/system/whirlpool.service +++ b/rootfs/standard/etc/systemd/system/whirlpool.service @@ -7,7 +7,7 @@ WorkingDirectory=/mnt/hdd/mynode/whirlpool ExecStartPre=/usr/bin/is_not_shutting_down.sh ExecStartPre=/usr/bin/wait_on_bitcoin.sh ExecStartPre=/usr/bin/mynode_pre_whirlpool.sh -ExecStart=/usr/bin/java -jar /opt/mynode/whirlpool/whirlpool.jar --server=mainnet --tor --auto-mix --mixs-target=3 --listen +ExecStart=/usr/bin/java -jar /opt/mynode/whirlpool/whirlpool.jar --server=mainnet --resync --tor --auto-mix --mixs-target=3 --listen User=bitcoin Group=bitcoin Type=simple diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index e88546fc..105c867c 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -687,6 +687,7 @@ systemctl enable glances systemctl enable webssh2 systemctl enable tor systemctl enable loopd +systemctl enable poold systemctl enable rotate_logs systemctl enable corsproxy_btcrpc diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 3fdb8d9e..b64ad42c 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -415,6 +415,24 @@ def get_mynode_status(): status = STATE_UNKNOWN return status +#================================== +# Log functions (non-systemd based) +#================================== +def get_file_log(file_path): + status_log = "" + + if not os.path.isfile("file_path"): + return "MISSING FILE" + + try: + status_log = subprocess.check_output(["tail","-n","200",file_path]).decode("utf8") + lines = status_log.split('\n') + lines.reverse() + status_log = '\n'.join(lines) + except: + status_log = "ERROR" + return status_log + #================================== # Specific Service Status / Colors #================================== diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index f37649f6..4ac75c67 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -158,18 +158,16 @@ def page_status(): quicksync_status_log = "ERROR" # Get Bitcoin Status - bitcoin_status_log = "" - try: - bitcoin_status_log = subprocess.check_output(["tail","-n","200","/mnt/hdd/mynode/bitcoin/debug.log"]).decode("utf8") - lines = bitcoin_status_log.split('\n') - lines.reverse() - bitcoin_status_log = '\n'.join(lines) - except: - bitcoin_status_log = "ERROR" + bitcoin_status_log = get_file_log("/mnt/hdd/mynode/bitcoin/debug.log") + # GET lnd, loopd, poold logs from file??? + #lnd_status_log = get_file_log("/mnt/hdd/mynode/lnd/logs/bitcoin/mainnet/lnd.log") + #loopd_status_log = get_file_log("/mnt/hdd/mynode/loop/logs/mainnet/loopd.log") + #poold_status_log = get_file_log("/mnt/hdd/mynode/pool/logs/mainnet/poold.log") # Get Status lnd_status_log = get_journalctl_log("lnd") loopd_status_log = get_journalctl_log("loopd") + poold_status_log = get_journalctl_log("poold") lndhub_status_log = get_journalctl_log("lndhub") tor_status_log = get_journalctl_log("tor@default") electrs_status_log = get_journalctl_log("electrs") @@ -219,6 +217,9 @@ def page_status(): "loopd_status_log": loopd_status_log, "loopd_status": get_service_status_basic_text("loopd"), "loopd_status_color": get_service_status_color("loopd"), + "poold_status_log": poold_status_log, + "poold_status": get_service_status_basic_text("poold"), + "poold_status_color": get_service_status_color("poold"), "tor_status_log": tor_status_log, "tor_status": get_service_status_basic_text("tor@default"), "tor_status_color": get_service_status_color("tor@default"), diff --git a/rootfs/standard/var/www/mynode/templates/status.html b/rootfs/standard/var/www/mynode/templates/status.html index 8e6d22c7..7df2f712 100644 --- a/rootfs/standard/var/www/mynode/templates/status.html +++ b/rootfs/standard/var/www/mynode/templates/status.html @@ -31,6 +31,11 @@ $("#loopd_status").show(); }); + $("#show_poold_status").on("click", function() { + $("#show_poold_status").hide(0); + $("#poold_status").show(); + }); + $("#show_lndhub_status").on("click", function() { $("#show_lndhub_status").hide(0); $("#lndhub_status").show(); @@ -244,6 +249,17 @@
{% endif %} + {% if lnd_wallet_exists %} +
Pool Status
+
+
+ {{ poold_status }} +
+ + +
+ {% endif %} +
Electrum Server Status
diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 7ae90240..06ed3301 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -773,6 +773,7 @@ systemctl enable bitcoind systemctl enable seed_bitcoin_peers systemctl enable lnd systemctl enable loopd +systemctl enable poold systemctl enable lnd_unlock systemctl enable lnd_backup systemctl enable lnd_admin_files