This guide will explain how to set up a working Lightning Network node at home, consisting of Bitcoin Core (mainnet) and Lightning Network Daemon (LND). Running a Lightning Network node (such as LND) requires a backend blockchain watcher (such as Bitcoin Core) in order to see what on-chain transactions are occurring. The second half of this guide shows how to connect the two, as well as add the Zap Desktop graphical user interface to your node.
We've included specific details for each step, with the assumption that users are not completely comfortable with using the CLI (Command Line Interface). Given the stage of the network, creating a local, secure Lightning Network node will require a small amount of CLI interaction.
The Bitcoin blockchain is large and continues to grow, so we recommend at least 250 GB of free disk space. If you want to sync either Bitcoin Testnet or Litecoin you'll need significantly less space. Downloading the blockchain is the longest part of the entire process (anywhere from a few hours to a number of days), while installing and connecting LND and Zap Desktop should take 10-20 minutes.
When you download Bitcoin Core, you'll be prompted to review space requirements and specify a data directory (where the blockchain is saved). In this example we'll use the default directory.
Start! You'll see this screen on startup below, and it can take some time to migrate to the status screen. Don't be discouraged if it hangs while working slowly in the background. You can always check debug.log to see the details.
Wait... Depending on your computer, internet connection, or external hard drive, this can take anywhere from a few hours to a week.
Running Bitcoin Core does not open certain connections for LND by default. Bitcoin Core uses a file called
bitcoin.conf that contains settings that allow the software to talk with LND. For those familiar with editing
bitcoin.confhere is what's needed:
# server=1 tells bitcoind to accept JSON-RPC commandsserver=1# Enable publish raw block in <address>zmqpubrawblock=tcp://127.0.0.1:28332# Enable publish raw transaction in <address>zmqpubrawtx=tcp://127.0.0.1:28333# On client-side, you add the normal user/password pair to send commands:rpcuser=rpcuser_here_844585# change this passwordrpcpassword=rpcpassword_here_12574
Another way is to download the bitcoin.conf provided below. You can open it in any text editor.
We have to ensure this configuration file is in the correct directory for Bitcoin Core to find it. Start by going to your bitcoin directory.
bitcoin.conf to that directory.
Restart Bitcoin Core. It should now be able to connect to LND once we have both running.
LND, or the Lightning Network Daemon, is the software that interacts with other users on the Lightning Network. There are a few ways to install LND:
From Releases: https://github.com/lightningnetwork/lnd/releases
In this example, we'll download the the latest release. Select the correct version for your operating system.
The download directory should include both
lnd: Runs the daemon
lncli: Interacts with the daemon
For those familiar with editing
lnd.confhere is what's needed:
Another way is to add it into the command used to run LND. This is where you'll have to step into the terminal for a brief moment.
Make sure bitcoin core is running
lnd into the terminal from your finder/explorer window
--bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpcuser=rpcuser_here_844585 --bitcoind.rpcpass=rpcpassword_here_12574 --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
Keep this terminal window open
Here is a summary of what each of those flags mean:
--bitcoin.active connects to the bitcoin chain (instead of litecoin)
--bitcoin.mainnet connects to mainnet (instead of testnet)
--bitcoin.node=bitcoind connects to the bitcoind backend
--bitcoind.rpcuser is the rpc username in bitcoin.conf
--bitcoind.rpcpass is the rpc password in bitcoin.conf
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 is the socket which sends rawtx notifications from bitcoind
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28333 is the socket which sends rawblock notifications from bitcoind
There should be a prompt that says:
Waiting for wallet encryption password. Use lncli create to create a wallet, lncli unlock to unlock an existing wallet, or lncli changepassword to change the password of an existing wallet and unlock it.
Now you have LND up and running, it's time to set up a wallet.
Open a new terminal window (or new tab).
lncli into the terminal. This lets the terminal know you're entering an LND command.
create and press enter.
Create a password. Your password must be at least 8 characters. Note that you won't see any of your password characters as you type them, but LND will ask you to confirm your password a second time.
LND will ask if you have a passphrase. You can enter 'n' here, or enter a passphrase for extra security (your password unlocks your wallet, whereas your passphrase is used for encryption and decryption).
Save your seed phrase! This is necessary for recovering your on-chain wallet if LND is lost or uninstalled.
Once you've created your wallet we need to check that everything is working. We'll use a command called
getinfo to see our node's information.
Run your first command!
lncli into the terminal
And you're off!
If interacting through the command line interface is not your thing, then let's connect to Zap Desktop . This will give you a functional GUI to check your on and off-chain balance, as well as your channels.
lnd is running before connecting.
Download Zap wallet: https://zap.jackmallers.com/
Create a new wallet.
Connect your own node.
Now you're wondering, "I ran through the installation process and got everything connected. What happens if I restart my computer?"
You'll have to make sure that you start both pieces of software again, and unlock your wallet.
Start Bitcoin Core
lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpcuser=rpcuser_here_844585 --bitcoind.rpcpass=rpcpassword_here_12574 --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
or unlock with zap wallet