How To Ride The Lightning!

Saubyk
Saubyk
Nov 25, 2018 · 10 min read
Ride The Lightning

With the tongue firmly in cheek ;-), this is a how-to guide on operating a LND node, with ‘Ride The Lightning’ Web UI, running on LND/Bitcoin.

For the un-initiated, ‘Ride The Lightning (RTL)’ is a platform agnostic web application to manage the LND node operations. Introductory post here.

RTL UI is now available on the following platforms (thankful to all):

  1. Nodl
  2. RaspiBlitz
  3. BTCPayserver

Prerequisites

This guide assumes you have setup the required application stack i.e. Bitcoind/LND/RTL. In case you need help with setting up Lightning network node with the complete app stack, you can follow the below guides:

Windows/Mac users can follow Pierre Rochard ‘s Node Launcher

Linux/Raspberry Pi users can follow Stadicus ‘s guide.

Once the full node is setup you can follow the setup instructions on RTL’s github repo for installation.

With the setup of the application stack complete, you need to fire up LND and create a LND wallet with ‘lncli create’ on the command line. Once this is done, you are ready to start using the ‘Ride The Lightning’ app to manage your lightning node operations.

The rest of this post focuses on the UI features available to the users and how a new user can get started on RTL. The high level list of UI feature available on RTL is below:

  1. Home Page (Dashboard and Node Status)
  2. LND Wallet (Wallet functions available on LND)
  3. Peers (Manage LN Peers)
  4. Channels (Management and Pending/Closed status)
  5. Payments (List Payments, Verify and Send Payments)
  6. Invoices (Generate Pay request, List Invoices)
  7. Lookups (Query Nodes and Channels on the network)

Home Page

Home

The Home page provides an overview of the critical parameters for your node, which you need to monitor.

Top line shows the parameters like ‘Wallet Balance’, Number of network ‘Peers’ connected, ‘Channel Balance’ and ‘Chain Sync’ status.

Lower section displays Fee Report, Channel Status, Local vs Remote Channel capacity and Network Information from your node.

To become operational on lightning network, you need to follow the below three steps:

Step1: Fund Your Node

LND Wallet Features

To get started on the lightning network node, the first step is to fund your node. You can access the wallet features on RTL, by clicking on ‘LND Wallet’ menu. You can generate a new address to deposit your coins (Lightning is still in experimental phase so be #craeful ;-)).

In the the ‘Receive Funds’ section, you can select the address type as ‘np2wkh’ and click on ‘Generate Address’ to generate a new address. Its advisable to generate a new address every time you are adding funds to your node. Once you have added some funds to your node, the funds will initially show up under the ‘Total Balance’ and ‘Unconfirmed Balance’ panes, and will show up under the ‘Confirmed Balance’ after the funding transaction is mined and confirmed.

You can also use the ‘Send Funds’ section to move your coins out of your node. Please note that only the funds available under ‘Confirmed Balance’ can be moved out of your node. While sending funds out, you can chose either a fee rate (e.g. 1 sat/byte) or target confirmation block.

There is an additional option available ‘Sweep All’ while sending funds out. If chosen, this option will result in all the confirmed funds being moved out of your node. Additional password authentication is required when ‘Sweep All’ option is used to empty the nodes of all the funds.

Once the node is funded you are ready to connect with peers and open channels.

Step 2: Connect with Peers

Manage Peers

Connecting with peers is the next step required to become operational on lightning network. When LND is instantiated, it tries to find peers automatically to connect with your node, which you can view on the Peers screen. You can also locate peers from other sites like yalls.org or 1ml.com to connect with.

To connect with a peer you need a public key of the peer and you can enter that key on the ‘Add Peer’ panel, where it prompts for ‘Lightning Address’ and click on ‘Add’. If the peer is live and available, you will get a ‘Peer Added Successfully’ message and you can refresh the screen, to view the peer on the list below.

You can also click on any row in the list, to view the detail of the connected peers. To disconnect with a peer you can click on the chain link control on each row for a peer, which is under the column ‘Detach’. If no channels are open with the peer, the peer will be disconnected.

Next step is to open channels. You will be able to open channels, only with the connected peers.

Step 3: Channels

Channel Management

There are three sections under the ‘Channels’ menu.

  1. Management
  2. Pending
  3. Closed

‘Management’ page menu allows you to open/close channels with your connected peers and also shows a list of active and inactive channels.

Active channels — Operational channels which can be used to make/receive payment depending on the channel outbound/inbound capacity.

Inactive channels — Channels with offline peers. Inactive channels are non-operational, and will remain so until the peer comes back online.

Opening Channels

A channel can be opened with a peer in the ‘Add Channel’ section of the screen. Select the peer from the Alias drop down menu, provide the amount in satoshis, you need to commit to the channel and click ‘Open’. If the channel is successfully opened, you will get a confirmation. The channel will not appear on the list, until the funding transaction is mined on the chain and confirmed. Until the channel is in pending status it can be viewed on the ‘Pending’ page under the ‘Channels’ menu. Once the transaction is confirmed you can view the channel in the list and click on the row to open the details of the channel.

Closing Channels

To close a channel, you can click on the icon on the ‘Close’ column of the channel row. The close channel control will wait until the block is mined and closure is confirmed. If the channel was active at the time of closure, the funds will appear in the ‘LND Wallet’ section. If the channel was inactive at the time of closure, your funds in the channel are not be available to you immediately, and you will have to wait for some time (depending on the time-lock-delta value of the channel) to get the funds back in your wallet.

Managing channels (A few basic ideas to get you started)

  1. Ensure that you have both incoming and outgoing liquidity for a good balance of channels on your node. This entails your network peers opening channels with you and you with them. Usually for the same amount. This will allow you to both send and receive payments. Your aggregate channel balances (sum of incoming and outgoing capacity for active channels) is available on the dashboard.
  2. Channel capacity dictates how much you can send or receive. Its better to open a few large capacity channels, with your liquidity, rather than many smaller sized channels.
  3. Channel re-balancing can currently be done by self-routing or submarine swaps. Self-routing will be made available in RTL in the future releases. Submarine swaps are a method to buy balances on the receiving side, by making an on-chain payment.
  4. Routing fee being charged over the channels, determines if your node will be used to route payments. This can get competitive. If you charge too high a fee, the routing will be done around your node, using the nodes charging less than you. The fee has two components ‘Base Fee’ and ‘Fee Rate’. Base fee is a flat amount charged for each payment routed. Fee Rate is applied on the amount being routed through the channel. So, the routing revenue earned on the node, depends on both the number of transactions routed, as well as the amount routed over the channels on your node.
  5. Once you have opened channels, you can update the channel fee policy. You can update the routing fee you are charging on your channels, by clicking on the edit icon appearing on the channel rows. The Channel policy can also be updated for all the channels with one update by selecting the top edit icon on the grid.
Update Channel Policy

Refer to some of these resources for more information on this interesting topic:

Recent thread from Alex on routing

‘Pending’ page allows you to view the details of the channels in various pending stages.

Pending Channels

There are four categories of the pending channels, which can be viewed under this page. ‘Pending Open Channels’, ‘Pending Force Closing Channels’, ‘Pending Closing Channels’ and ‘Waiting Close Channels’.

‘Closed’ page, shows the history of all the closed channels for your node.

Closed Channels

The ‘Close Type’ field on this page, provide some indication on why or which side closed the channel. E.g. ‘REMOTE_FORCE_CLOSE’, ‘LOCAL_FORCE_CLOSE’ or ‘FUNDING_CANCELED’ etc.

Overall, effective node management requires active monitoring of all the important parameters.
1. Node sync status
2. Connected Peers
3. Channels (Monitoring inactive channels, ensuring channels are balanced)
4. Fee Report for routing fee earned


Rest of the post, will provide an overview of additional features like making lightning payments and generating invoices.

Making Lightning Payments

Payments page has two sections. Top one for verifying & sending payments and the lower one for listing payments.

Payments

Lightning payment requests or invoices need to be entered in the ‘Payment Request’ to make payments. Upon on hitting the ‘Send Payment’ button, the invoice is decoded and details presented for confirmation.

Decoded Payment Request

If you click on ‘Send’, the same invoice will be paid. Upon successful payment, you will get a confirmation message like the one below:

Payment Success

All the payments made successfully by your node are also listed on the lower section of the page. You can click on each row to view the details of the payments made in the past.

Invoices

Invoices

This section allows you to generate invoices for any amount that you wished to get paid for. You can enter the memo text (optional) and the invoice amount in satoshi (optional) and click on ‘Add’ to generate the invoice.

Upon the generation of the invoice, you can copy the payment request from the confirmation screen and share with the party, from whom you want to get paid. QR code of the Invoice is also displayed. The confirmation screen will look like below:

Generation of Invoice

Upon refreshing the screen, you can see the generated invoice added to the list. You can click on the row to view the detail of the invoice and also check the status.

Invoice Detail

Lookups

Lookups allow your to query any nodes or channels on the network including your peers and channels

For querying nodes, you need the pub-key of the node.

Node Lookup

For querying channels, you need the Channel ID.

Channel Lookup

There are some other cool features on the app like skins customization for look n feel preference and toggling of the units from BTC to Sats, which we are not getting into, as its pretty intuitive.

We are actively working on adding more features on the app, to make it more complete from the point of the view all the functionality available on LND. While also working on improving the usability of working with a full node. We will keep this post active and fresh as more features are rolled out on the app.

We look forward to feedback from all the users, who can help us make the application better and also make lightning network more and more usable for anyone and everyone.

Please feel free to open issues on our github (referenced below) if you encounter any problems. We also maintain an active feature list and roadmap on our git repo.

That’s all for now. If you have any questions or feedback, please leave a comment or find me on twitter @Suheb__

Follow the app twitter account @RTL_App for more real time updates.

Lets Ride The Lightning, together! :-)

Thank You!

References

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store