Thunderhub

Time: 20 minutes

Thunderhub, like Ride The Lightning, is a management tool for your node. Visit the website to discover all the features.

Requirements

Source code

Download the source code from Thunderhub.

git clone https://github.com/apotdevin/thunderhub

Go to the code.

cd thunderhub

Get the latest version/tag/release.

git checkout v0.13.23

Get all the necessary software dependencies.

npm install

Configuration

Create the file .env.local:

nano .env.local

Paste the following into it:

ACCOUNT_CONFIG_PATH='/home/ubuntu/.thunderhub/config.yaml'
PORT=4000

Save it with Ctrl + X and confirm with Y. This is a minimal setup in terms of configuration. More parameters that you can use are in the .env file.

Now we go back to your home directory and create a folder called .thunderhub. In this folder, we will create a config file for Thunderhub.

mkdir ~/.thunderhub && nano ~/.thunderhub/config.yaml

Paste this in:

masterPassword: 'PASSWORD_HERE'
accounts:
- name: 'ANY_NAME_HERE'
serverUrl: '127.0.0.1:10009'
lndDir: '/home/ubuntu/.lnd'

The masterPassword you can modify as you wish and you will need it to log into Thunderhub in your browser later. After you start Thunderhub for the first time, this password will be rewritten with a hashed value. Save it with Ctrl + X and confirm with Y.

Installation

We'll go back to the directory containing the Thunderhub software if you weren't already there:

cd ~/thunderhub

To install Thunderhub:

npm run build

Firewall

Open port 4000.

sudo ufw allow 4000 comment "Port for Thunderhub"

Should you wish to use Thunderhub from outside your network, you must throw open port 4000 on your router and forward traffic to your Pi.

Automation

How do you make Thunderhub start up automatically? For that, we create a Thunderhub service file:

sudo nano /etc/systemd/system/thunderhub.service

Paste this into it.

[Unit]
Description=Thunderhub
Requires=lnd.service
After=lnd.service
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/thunderhub
ExecStart=npm start
Restart=always
TimeoutSec=120
RestartSec=30
[Install]
WantedBy=multi-user.target

Save it again with Ctrl + X and confirm with Y. The application is started on port 4000. By default this is port 3000, but this port is also used for the Ride The Lightning application.

The system must be notified of the new service and can then be started.

sudo systemctl enable thunderhub
sudo systemctl start thunderhub

If you want to see if everything started up properly, run this:

systemctl status thunderhub

If you want an overview of the status over multiple session, use this:

sudo journalctl -f -u thunderhub

Using

Go to http://[the ip address of your Pi]:4000 in your browser to open Thunderhub.
Use the password password to log in unless you entered a different password in the config.yaml file.

Updating

When upgrading a Thunderhub from before v0.13.0 to v0.13.0+, changes to the .env.local file are required. Please take a look at the section "configuration".

Go to the application directory.

cd ~/thunderhub

Update the repository with the latest changes via Git.

git fetch --all

Show the latest version/tag/release.

git describe --tags `git rev-list --tags --max-count=1`

Retrieve the changes from the latest release.

git checkout -f <OUTPUT FROM PREVIOUS STEP> # For example, v0.13.23

Install the software.

npm install
npm run build

Restart the Thunderhub service.

sudo systemctl restart thunderhub

Thunderhub is now updated!