How to Run a Lightning Node on a Synology NAS Drive

Lightning Node and Synology NAS Setup Guide

In this tutorial, we will be setting up a lightning node docker container on a Synology Network-attached storage (NAS) device. Network-attached storage is also about claiming full ownership over your data and considering that a typical NAS might likely have spare storage, typically running 24/7, this makes them perfect candidates on which to run a Lightning Node. In this tutorial, we will be setting up a Lightning Node docker container on a Synology Network-attached storage (NAS) device using just a few simple steps. Synology Inc. is a Taiwanese corporation that specialises in Network-attached storage appliances, working with a linux based distribution out of the box, and it is with a Synology NAS that we are going to show how this handy combination of hardware and software can be used to create a Lightning Node of your own. Building on a previous tutorial that guides you through running a full bitcoin node on Synology NAS, we will utilise the same method to fire up a lightning node.

https://nascompares.com/2019/03/19/how-to-run-a-bitcoin-node-on-your-synology-nas/

Lightning Node and Synology NAS – What you need

We will be deploying a c-lightning docker instance on testnet using Synology Disk Station Manager (DSM) and interact with it through SSH. For this tutorial, we will be deploying a docker instance using Synology Disk Station Manager (DSM), the linux based operating system running your Synology NAS. Through DSM, you can manage and search files/folders, view files of various types, share private files with external users, mount remote folders and virtual drives for access, and do much more. To continue, you will need to access your NAS via a web browser. The default HTTPS port number is 5001, so you can securely access DiskStation Manager (DSM) by visiting https://server-hostname:5001/, where server-hostname is the host or ip address of your NAS.


Lightning Node and Synology NAS Step 1

We first have to create a folder where lightning node data will be stored by opening File Station and creating the following folder /docker/c-lightning-testnet or any other name that suits your needs.

Lightning Node and Synology NAS Step 2

We then need to create a configuration file for lightningd. Open a new file with your favourite text editor, add the following line and save it as config – no extension – under the previously created folder.

Lightning Node and Synology NAS Step 3

Next, we need to install and run c-lightning. To install c-lightning we will use Docker and download the image published by Blockstream. Launch Docker through DSM, go to the Registry tab, search for lightningd and download the image from elementsprojects.

Lightning Node and Synology NAS Step 4

Once downloaded, we have to setup the container before starting it. Go to the Image tab, select the lightningd image and click Launch. Provide the preferred name and click the Advanced Settings option.

On the first tab, you may want to enable auto-restart to have your lightning node automatically booting up with your NAS. From the Volume tab, select Add Folder, enter your local path in File/Folder and /root/.lightning as Mount path.

Lightning Node and Synology NAS Step 5

We then select the Network tab and check the Use the same network as Docker host option, this simplify things going forward. Finally, click Apply, followed by Next, and Apply to launch our container.

Lightning Node and Synology NAS Step 6

We can confirm the configuration and setup of our lightning node by viewing the lightningd logs. To do so, go to the Container tab, select the corresponding container and click Details. Select then the Log tab and see 🙂

Lightning Node and Synology NAS Step 7

Next, we will go through how to connect to the containers shell. While there is a Terminal tab in Docker GUI of DSM, it does not allow to paste text from the clipboard which makes it highly inconvenient. We will, therefore, connect to our c-lightning container shell through the terminal.

We can access our NAS terminal using ssh as follows.

Once connected to the NAS, we have can identify lightningd container id with the following command.

And finally, connect to our container’s shell as follows.

We are now ready to interact with the lightning network, but first, we have to fund our node.

Lightning Node and Synology NAS Step 8

Now we will go through how to fund the lightning node. We will begin by retrieving a payment address.

Lightning Node and Synology NAS Step 9

We can now send some testnet bitcoin to our lightning node. If you don’t have any you can use Yet Another Bitcoin Testnet Faucet which works like a charm. Note that we will have to wait for three blocks before the status changes to confirmed which we can check using the listfunds command.

Lightning Node and Synology NAS Step 10

Opening a Channel is next. From the previous command we can also see that our channel list is empty, we will now open a channel with a random node to get started. Select one from 1ML and connect.

Lightning Node and Synology NAS Step 11

Once connected, we can fund the channel as follows.

We won’t be able to fund another channel before the previous is confirmed which we can check by using the listfunds command.

To complete our lightning node operating capabilities, we should get some inbound capacity, i.e. a node that opens a channel with ours but that’s another story and not within the scope of this tutorial! Feel free to explore this further and let us know what you think!

Lightning Node and Synology NAS Guide Conclusion

We have a lightning node running on the bitcoin testnet using just a few clicks and commands. Please bear in mind the following from c-lightning README but do not hesitate playing around with it on the testing network.

IMPORTANT – This implementation is still very much a work in progress. It can be used for testing, but it should not be used for real funds.


 

Credit to Simon Castano

Special thank you to SIMON CASTANO at https://bitcoindev.network/ for giving us permission to share this guide with fellow Synology NAS owners. Find out more on how to make the most of your NAS and he aims at developing an open source crypto fund management application, at https://www.brane.cc/

 



 

Visit the NASCompares Deal Finder to find the best place to buy this device in your region, based on Service, Support and Reputation - Just Search for your NAS Drive in the Box Below

 

SEARCH IN THE BOX BELOW FOR NAS DEALS

Need Advice on Data Storage from an Expert?

We want to keep the free advice on NASCompares FREE for as long as we can. Since this service started back in Jan '18, We have helped hundreds of users every month solve their storage woes, but we can only continue to do this with your support. So please do choose to buy at SPAN, use links to Amazon on the articles when buying to provide advert revenue support or to donate/support the site below. Finally, for free advice about your setup, just leave a message in the comments below here at NASCompares.com and we will get back to you. Need Help? Where possible (and where appropriate) please provide as much information about your requirements, as then I can arrange the best answer and solution to your needs. Do not worry about your e-mail address being required, it will NOT be used in a mailing list and will NOT be used in any way other than to respond to your enquiry.

I am sending this data and accepting this Privacy Policy.

Terms and Conditions Alternatively, why not ask me on the ASK NASCompares forum, by clicking the button below. This is a community hub that serves as a place that I can answer your question, chew the fat, share new release information and even get corrections posted. I will always get around to answering ALL queries, but as a one-man operation, I cannot promise speed! So by sharing your query in the ASK NASCompares section below, you can get a better range of solutions and suggestions, alongside my own.  

Leave a Reply