Lesson Ready to Start
Foundational

Install & Connect Terminal

Sign up or sign in to start lessons, track your progress, take quizzes, and earn achievements.

This introductory video walks you through the installation process of the Lightning Terminal Daemon (Litd). Litd is a powerful bundle that provides tools for node management, health checks, automatic fee adjustment, and more.  You'll learn how to install Litd from source in both integrated mode (with LND) and remote mode (alongside an existing LND node). Finally, the video demonstrates how to connect your Litd instance to Terminal on the web for convenient remote management of your Lightning node.
Video length: 13 mins 28 secs

Comment below with questions, suggestions and corrections.

Go to Comments

Transcript

Hello and welcome to the terminal demo series. I'm Hannah with Lightning Labs. And this is the first video in a series where we'll be walking through using terminal your all in one node management tool from health checks to auto fees to loop pool.

And more in this first video, we'll install the lightning terminal, Damon Litd and we'll connect to terminal on the web. But remember that Litd is a bundle that includes Loop, Pool, Faraday, Taproot Assets and LND.

If you'd like, you can also run Litd next to an existing LND node. So this gives us a number of different ways in which we can install Litd if you'd like to install Litd in integrated mode with me, which means with LND if you like to do that from binaries. Well, you can go watch the speed run video which walks you through that process.

Also if you'd like to install Litd again in integrated mode with LND but do it from source, well, you can go watch the launch with the video from the Tapd demo series and links to all these videos and all the other resources we discuss are in the description for this video.

All right. But here in this video, we'll be installing Litd from source but using it in remote mode as I already have a server, LND server up and running on this node.

So over here, this is my existing LND node which I have up and running and will be installing Litd on this alongside LND.

Cool. So let's go through a few notes. Before we start the installation process, we'll need to have as we're installing this from source, we'll need to have recent versions of both go and node on your machine. So again, yo to server, this is, it has an existing LND test net node.

So we'll start by check, taking a look at what our current go version is. And OK, we have go1.21.3 which has a recording is the very I'm not sure it's quite the latest, but it's a new version.  We'll also check out what version of node we got and we have v21.5.0 which I think is the latest as of recording. Cool.

So now we have what we need. Let's take a quick look at what is currently running on this machine using my favorite command here:

sudo lost -n -P -I | grep LISTEN

Again, this is a test net node of mine. So I test all kinds of things here and I've got all sorts of stuff running, but we can take a look at the relevant things for us today. And that is we have a bitcoind back end running and we have an existing LND node. But you know, we do not yet have a Litd process running here. Cool.

So first thing we're going to do is clone the repo:

git clone https://github.com/lightninglabs/lightning-terminal 

So this is a lightning labs, re repo and it's just lightning dash terminal and we're going to clone that and head on in there and check out the latest version:

cd lightning-terminalgit
checkout v0.12.2-alpha

So as a recording this version here, 0.12 0.2 alpha is our latest. So we're gonna check that out and then it's a very, very simple make install and that only take a few minutes, but I'll fast forward it for you, ok?

make install

And we're back, it only took a couple of minutes, but now we have Litd.

So let's just go out here and take a look at it.

cd go/binls -lah

Cool. There we go. We can see that it is installed.

It's also another thing I want to do here is we want to check one setting in our LitdK or LND config file to make sure that it's going to cooperates with Litd. So let's just go have a look. It should be a .lnd/lnd.conf.

cdvim .lnd/lnd.conf

Excellent. And this is exactly what we're looking for RPC middleware enabled: true. So we have that we're all set. Cool.

All right. Now, at this point, we could just start up Litd using just setting a UI password. Let's clear this out. There we go. We could use a command looking like this and we could start Litd and run it right now.

litd --uipassword=<your secure and unique password>

But I prefer to set up a config file and assist in the service so that it's a bit more robust if that node of this node restarts at 2AM I know everything's gonna come back up and start working again. 

So let's go ahead and set that up. What I'm gonna do first is make a dot Lit directory, a data directory for Litd. Cool. So we're gonna make that directory and we're gonna head in there. Oops, let's try that again. There we go. And we're gonna make a config file just called lit.com.

mkdir .litcd littouch lit.conf

Cool. And let's go add some stuff to it. So here I'm gonna copy and paste in a lit the configuration file and we will talk through it. 

lnd-mode=remote
network=testnet
uipassword=password
remote.lnd.rpcserver=127.0.0.1:10009
remote.lnd.macaroonpath=/home/ubuntu/.lnd/data/chain/bitcoin/
testnet/admin.macaroon
remote.lnd.tlscertpath=/home/ubuntu/.lnd/tls.cert
httpslisten=0.0.0.0:8443

Cool. All right. So first of all, we are noting that Litd LND is running remote, right? So this is from Litd's perspective, we already have an LND node on this machine so that LND is remote to Litd. And in a sec here we'll see, we give it some information to make sure it knows how to connect to LND.

Couple more really important things. We are running on test nets. So we need to make sure Litd knows that. Otherwise we might get weird macaroon errors and, you know, various other issues.  All right, we want to set a UI password. Obviously, if you're doing this on a production machine, you want to set a much, much better password than this. These next three lines are just telling us how to, telling Litd how to talk to LND. It's all the standard stuff, you know, the default stuff, you know, this is the port that it's talking on. This is where to find the admin macaroon node. Again that we're using the testnet path cause we're running on testnets and it needs to know how to get to the TLS cert. Also, we're adding this line httpslisten and we're asking Litd to listen on this port so that we can access the UI on this machine here and we'll demonstrate that towards the end of the video. Cool. 

So this all looks good. Now, we're going to go create a systemd file. So let's do this. OK? Cool. We'll come down here and we're going to create the file. We're gonna call it LI D dot Service. 

cd /etc/systemd/system/
sudo touch litd.service
sudo vim litd.service

Awesome. And then I'm gonna copy and paste in a Litd a systemd config file here and we'll have a quick look at it.

[Unit]Description=Litd Lightning Terminal DaemonRequires=lnd.serviceAfter=lnd.service
[Service]ExecStart=/home/ubuntu/go/bin/litd litd
User=ubuntuGroup=ubuntu
Type=simpleRestart=alwaysRestartSec=120
[Install]WantedBy=multi-user.target

Cool. So let's start at the top. We have a description, you know LI TD lightning terminal, Damon. This requires LND and so we want to start up after LND starts up. This is where we'll find that program also with, Litd I add this little extra command there. Both the user and group are you to type simple restart, always give it a couple of minutes and on it up by a multi, multi user target. So pretty basic stuff. Nothing too fancy in there.

We'll save that and then we have to do our systemd stuff and enable that service and we'll use this command here to do that. 

sudo systemctl enable litd

Awesome. And then let's try and start it up and see what happens.

sudo systemctl start litd

Cool. And then I'll run this again, run my favorite command and we'll see if we can now see that process and see if we can see a Litd listening on that port. We listed in the config file.

sudo lsof -n -P -i | grep LISTEN

Excellent. There it is. So mission accomplished. We've got Litd running on this machine and it's all set up with a configuration file and on systemd.

But before we go, we'd like to also demo how you can use Litd that's now running on this machine to connect to terminal on the web.

So first thing we'll do is we'll need to note, you know, the IP address of this machine or domain name, whoever you're connecting to it and that port that you set in the config file and then we'll go have a look at it. And here you can see because we have not set a domain or assert. We're getting this error because we're just demoing this on test net. This is fine.

I'm gonna go ahead and proceed and then we need a password. This is the password we said in that config file.

And we can see here we have this UI which has all kinds of functionality. But in this series, we're gonna demonstrate using this functionality well connected to terminal on the web. So what we can do is come here and connect. Yeah, push this button and that'll help us connect to Terminal on the web.

Now you can, we've made a couple of videos on how this connection process works that uses LNC lightning node connect. And I have this nice graphic here to show you right. We have LND and Litd running on this machine. We're gonna use LNC here via this mailbox to connect to terminal.

That's all we're going to talk or that's all we're gonna say about this connection process. And this video, you can watch the other videos if you're curious as to how that works, but we can watch it all happen here when we just push this button.

Awesome. Look at that. So this drops in our 10 word pairing phrase. Now this is a one time use pairing phrase, but you know, you don't want to broadcast it to the internet. Still. Let's generally not do that. All right. So let's connect.

We'll set the password, then you want this to be pretty secure. Don't need to save that. And here we go, we're connected, you can check it out. This is the name of this particular test net node L402s-R-Fun because they are.

But before we go, I also demonstrate how to connect. If you just wanna generate that string on the command line rather than via the UI.

So let's disconnect from here. All right. So we can close out of this. And we're just gonna stay here at terminal.lightning.engineering. And we'll log in in a moment. But first, we're gonna go back to our machine and via the command line, we're gonna generate that connection string.

So let's clean this up a little bit and then we'll have a look at this command.

litcli --network=testnet sessions add --label="default" --type=admin

We're using the Litd cli again, we have to note that we're on the test net. We're gonna add a session just giving it the label default and type admin. Although there are many other types you can use as well.

Cool. And here we go, we have our connection string again, something that you would generally not broadcast to the internet, but here it's fine. Just demoing.

Cool. We'll enter our connection phrase and connect.

Awesome. And once again, set a password.

And there you go two different ways to connect to Terminal on the web. Awesome.

All right. So let's just recap what we've done today. We've installed Lightning Terminal Daemon (Litd). And remember this is a bundle that includes Terminal, Loop, Pool, Faraday, Taproot Assets and LND if you'd like, you can also run Litd next to an existing node which we have done here. And again, all of the links to the things we discussed are in the description. And as always, you can check out docs dot lightning dot engineering for more info.

Views: 65
Course Navigation
Install & Connect Terminal

0 Comments

Please login to post comments.