Lightning Node Setup

By candoizo on Feb 3, 2020
Image post 4

How to setup a bitcoin node on Linux without helpers. btcpayserver is a godsend, along with many prebuilt like Umbrel and RaspiBlitz are great experience for end users unconcerned about more than their finances. At a time they weren’t so great, and when looking to integrate a bitcoin node into your existing node using them may not be an option. Here is a simple guide to refresh your setup with. We prepare a Bitcoin node, a Lightning Node, then we remove the Bitcoin node entirely with Neutrino! Light clients are cool.

Requirements

  • Solid state drive with 1TB of space, unless skipping directly to Neutrino
  • Git installed on your machine.
  • Systemd installed on your machine.

Steps

In this example I’ll be using Arch Linux. The repositories come with bitcoin core and AUR comes with lnd, or you can get them from the source using the following steps.

Bitcoind

  1. Download the Bitcoin Core daemon from the official Bitcoin website.

  2. Extract the contents of the downloaded file and move the bitcoind executable to the /usr/local/bin directory.

  3. Create a configuration file for Bitcoin Core in the ~/.bitcoin directory. The file should contain the following lines:

daemon=1
server=1
rpcuser=<username>
rpcpassword=<password>
  1. Start the Bitcoin Core daemon by running the bitcoind executable.

  2. Use the bitcoin-cli utility to interact with the Bitcoin network.

Lnd

  1. Clone lnd
git clone https://github.com/lightninglabs/lnd
cd lnd 
make release-install

Start the services

  1. Create systemd service files to enable them at boot
# if you want to start the daemon now, add `--now`
systemctl enable bitcoind lnd

Now you have configured a bitcoind and lnd node to start at boot using systemd!

Neutrino

Currently Bitcoin nodes consume around 1TB of space, and preferably you would rather not waste that space if you can’t spare it on a budget setup. For science lets turn it into a Neutrino light client! In your lnd.conf, add the following lines.

[Application Options]
feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json

[Bitcoin]
bitcoin.node=neutrino
bitcoin.dnsseed=nodes.lightning.directory,soa.nodes.lightning.directory

Now you can disable the bitcoind entirely and start lnd!

systemctl disable --now bitcoind
systemctl start lnd

Conclusion

Setting up a Bitcoin node is a kind way of contributing to the largest decentralized financial network’s availability! Adding a Lightning Network node taps you into a vibrant microeconomy build on top of bitcoin’s scrypt contracts!

Using your node in Neutrino mode eliminates one of the biggest barriers to participating in the Lightning Network and expands the scope of budget hardware for your experiments! Consider hooking up your node to ln-service to use your new service for accepting digital payments instantly without on-chain confirmation!