Table of contents
Hi everyone! Today, we are setting up an eclair node. If you're wondering, "What is eclair?", it is an implementation of the Lightning Network. It's coded in Scala, eclair can be your doorway into the world of the Lightning Network.
Why should you consider running an eclair node?
Well, if transacting with lower fees sounds appealing or you're keen on exploring the underpinnings of Bitcoin's Lightning Network, or maybe, you're a developer interested in contributing to the codebase - running an eclair node is for you.
In this guide, we're using Ubuntu 22.04
, Bitcoin Core 23.2
.
Let's start our journey with the first step - setting up Bitcoin Core(if you already haven't).
Step 1: Setting the stage with Bitcoin Core in regtest
Download Bitcoin Core 23.2 from its official webpage and extract the files.
Create a new directory named
.bitcoin
and inside it, abitcoin.conf
file with the following configuration:
server=1
txindex=1
regtest=1
rpcuser=user
rpcpassword=YourGeneratedPassword
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubhashblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29001
fallbackfee=0.0002
Time to secure your operation. Run the
rpcauth.py
file inside the/extracted-folder/share/rpcauth
to generate a password.
You can usepython3 rpcauth.py "username"
for it
ReplaceYourGeneratedPassword
in thebitcoin.conf
file with this generated password.Set the path to environment variable for
bitcoind
andbitcoin-cli
. Your.bashrc
would contain a line likeexport PATH=$PATH:/home/claddy/bitcoin-23.2/bin
Now, bring Bitcoin Core to life by running
bitcoind
.Create a wallet with the command
bitcoin-cli createwallet YourWalletName
.
Once you're comfortable, experiment with a few Bitcoin commands! If you want to experiment with a full node, instead of regtest, check out this guide.
Step 2: The lightning setup - eclair Node
First, download the latest version of the eclair node from the releases.
Extract the downloaded folder and create a
.eclair
directory(if it isn't by default).Inside the
.eclair
directory, create aneclair.conf
file with this content:
csharpCopy codeeclair.chain = "regtest"
eclair.node-alias=alias
eclair.server.port=9735
eclair.trampoline-payments-enable=true
eclair.api.enabled=true
eclair.api.port=8080
eclair.api.password=password
eclair.bitcoind.rpcport=18443
eclair.bitcoind.rpcuser=user
eclair.bitcoind.rpcpassword=YourGeneratedPassword
eclair.bitcoind.zmqblock="tcp://127.0.0.1:29000"
eclair.bitcoind.zmqtx="tcp://127.0.0.1:29001"
Make sure to append the
rpcuser
andrpcpassword
that you generated earlier usingrpcauth.py
.Again, help your system find its way by setting the path variable for the
bin
folder of the eclair node.Finally, run
eclair-node.sh
Declair.datadir=/home/your_username/.eclair/
. You'll be prompted for a password, enter the one you set in theeclair.conf
file. By default the value of the password ispassword
.
And voila! You're running your very own eclair node. Want to see what's happening? Check the .log
file in your directory. Get to know your node by running eclair-cli getinfo
in a new terminal.
The eclair API documentation is your friend if you want to explore further. Want to run multiple eclair nodes? Here's a GitHub link for you. And remember, eclair and Bitcoin documentation are always there to help you out.
This marks the end of our journey, and now, you've become a part of the Bitcoin Lightning Network. Any hurdles along the way? Reach me on twitter. Keep exploring, keep learning!