This tutorial explains how to set up a Bitcoin full node with a Lightning node on your server. Running a full node contributes to the strength and security of the Bitcoin network, and a Lightning node enables faster, cheaper transactions.
The most important requirement for implementation is a basic understanding of the Linux command line.
To set up a Bitcoin full node and a Lightning node, you need a server with the following characteristics:
The RS 2000 G8 SSD from netcup meets these requirements.
Order the RS 2000 G8 SSD from netcup if you haven't done so already. Existing customers can add the product easily and quickly.
After provisioning the server and logging in with the username root
and the password sent by email, update the basic configuration of the server.
passwd
.apt-get update && apt-get upgrade -y
.Download the latest Bitcoin Core release from the official website.
wget https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
Extract the downloaded archive.
tar xvf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
Change to the extracted directory.
cd bitcoin-24.0.1
Add the binaries to your path.
nano $HOME/.bashrc
Go to the end of the file and paste the following:
export PATH="$HOME/bitcoin-24.0.1/bin/:$PATH"
Save with Ctrl+O and exit with Ctrl+X.
Reload the changes with:
source $HOME/.bashrc
Create a default bitcoin.conf file.
mkdir $HOME/.bitcoin
nano $HOME/.bitcoin/bitcoin.conf
Paste the following:
server=1
daemon=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
Save with Ctrl+O and exit with Ctrl+X.
Start Bitcoin Core by typing bitcoind
in the terminal.
bitcoind
At this point, Bitcoin Core should start synchronizing with the network. It will download and verify the entire blockchain, which can take several hours to a few days.
Track the progress of your Bitcoin node synchronization.
tail -f $HOME/.bitcoin/debug.log
When the Bitcoin node is done synchronizing, you can continue with the next steps.
Download the latest release of LND from the official GitHub repository.
wget https://github.com/lightningnetwork/lnd/releases/download/v0.16.0-beta/lnd-linux-amd64-v0.16.0-beta.tar.gz
Extract the downloaded archive.
tar xvf lnd-linux-amd64-v0.16.0-beta.tar.gz
Change to the extracted directory.
cd lnd-linux-amd64-v0.16.0-beta.tar.gz
Move the LND binaries to the ~/bin
directory (create the directory if it doesn't exist).
mkdir -p $HOME/bin
mv lnd lncli $HOME/bin
Add the LND binaries to your path.
nano $HOME/.bashrc
Go to the end of the file and paste the following:
export PATH="$HOME/bin/:$PATH"
Save with Ctrl+O and exit with Ctrl+X.
Reload the changes with:
source $HOME/.bashrc
Create a default lnd.conf file.
mkdir $HOME/.lnd
nano $HOME/.lnd/lnd.conf
Paste the following:
[Application Options]
debuglevel=info
maxpendingchannels=10
alias=YourNodeAlias
color=#68F442
listen=localhost
[Bitcoin]
bitcoin.active=true
bitcoin.mainnet=true
bitcoin.node=bitcoind
Save with Ctrl+O and exit with Ctrl+X.
Replace YourNodeAlias
with a custom alias for your node.
Start LND with the following command:
lnd
Create a wallet using lncli create
.
After setting up your Bitcoin full node and Lightning network node, open another terminal window and create a wallet using the following command:
lncli create
Follow the steps described by the command-line interface to create a new wallet, including setting a wallet password, generating a seed, and backing up your seed phrase.
Congratulations! You now have a functioning Bitcoin full node with a Lightning network node and a newly created wallet.
For more information and basic usage of LND, check out the official LND documentation.
Remember to keep your seed phrase secure and make sure to have a backup, as losing it will result in the loss of your funds. Also, keep your server secure and up-to-date to ensure the safety of your Bitcoin full node and Lightning network node.
With your new setup, you can now participate in the Bitcoin and Lightning network ecosystems, send and receive transactions, and contribute to the overall health and decentralization of the network. Enjoy exploring the world of cryptocurrencies and the Lightning Network!
Now you have a Bitcoin full node with a Lightning node up and running. You can use lncli
to interact with your LND node, and you can connect your Lightning wallet to your node for sending and receiving payments.
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and I have the right to submit it under the licence indicated in the file; or
The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), as indicated in the file; or
The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the licence(s) involved.