Setting up Boltz-client on your LND Lightning Node
Automagically receive Lightning transactions on your node from a Bitcoin On-chain payment
We want to run boltz-client using a LND Lightning node running on Voltage. Of course you can use a different installation. What you need is the macaroon and the tls.cert . You can get them from Voltage if you are using such a facility. In this example LND is running on Voltage and we are working on a Debian VPS where we are going to install the Boltz client.
Install the client
Create a directory let’s say boltz-client and put the following docker-compose.yml file
version: "3"
services:
boltzd:
container_name: boltz-client
hostname: boltzd-client
image: boltz/boltz-client:latest
restart: on-failure
volumes:
- ${PWD}/.boltz:/root/.boltz
- ${PWD}/.lnd:/root/.lnd
get the prebuilt image
docker pull boltz/boltz-client:latest
now create the dirs
mkdir .boltz
mkdir .lnd
Create the file .boltz/boltz.toml with the following content:
# Path to the log file
logfile = ""
# possible values: fatal, error, warn, info, debug, silly
loglevel = "info"
# possible values: "mainnet", "testnet" or "regtest"
network = "mainnet"
# you will have to set this to "cln" or "lnd" if you have configuration values for both
node = "lnd"
[BOLTZ]
# By default the daemon automatically connects to the official Boltz Backend for the network your node is on
# This value is used to overwrite that
url = "https://api.boltz.exchange"
[DATABASE]
# Path to the SQLite database file
# path = "~/test.db"
[LND]
# Host of the gRPC interface of LND
# host = "127.0.0.1"
host = "yournode.m.voltageapp.io"
# Port of the gRPC interface of LND
port = 10009
# Path to the data directory of LND
datadir = "~/.lnd"
# Path to a macaroon file of LND.
# The daemon needs to have permission to read various endpoints, generate addresses and pay invoices
# Not required if datadir is specified
macaroon = "~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon"
# Path to the TLS certificate of LND
# Not required if datadir is specified
certificate = "~/.lnd/tls.cert"
[CLN]
# Host of the gRPC interface of CLN
# host = "127.0.0.1"
# Port of the gRPC interface of CLN
# port = 9736
# Path to the data directory of CLN
# datadir = "~/.lightning"
# Paths to TLS certificates and keys of CLN. Not required if datadir is specified
# rootcert = "~/.lightning/bitcoin/ca.pem"
# privatekey = "~/.lightning/bitcoin/client-key.pem"
# certchain = "~/.lightning/bitcoin/client.pem"
[RPC]
# Host of the gRPC interface
host = "127.0.0.1"
# Port of the gRPC interface
port = 9002
# Whether the REST proxy for the gRPC interface should be disabled
restDisabled = false
# Host of the REST proxy
restHost = "127.0.0.1"
# Port of the REST proxy
restPort = 9003
# Path to the TLS cert for the gRPC and REST interface
tlsCert = ""
# Path to the TLS private key for the gRPC and REST interface
tlsKey = ""
# Whether the macaroon authentication for the gRPC and REST interface should be disabled
noMacaroons = false
# Path to the admin macaroon for the gRPC and REST interface
adminMacaroonPath = ""
# Path to the read-only macaroon for the gRPC and REST interface
readOnlyMacaroonPath = ""
The .lnd/ must contain macaroon and tls.cert coming from your node.
Now you can start your container by running:
docker-compose up -d
Create a Onchain to Lightning Swap
Now you can create a new swap from Onchain to Lightning. In this case the swap will receive an onchain transaction and simultaneously issue a corresponding Lightning invoice of the same amount less fees.
dev@lnbits00:~/boltz-client$ docker exec -ti boltz-client boltzcli createswap --any-amount btc
The fees for this service are:
- Boltz fee: 0.1%
- Network fee: 453 satoshis
? Do you want to continue? Yes
Please deposit between 25000 and 25000000 satoshis into bc1pwk4w6xxx in the next ~24.0 hours (block height 879106)
Swap ID: zoZXkKI2b2cy
Status: swap.created
Now you should send the amount you want to swap to the above displayed address from Boltz. When you do that you will get
Status: transaction.mempool
Transaction ID: 34b9fa3adb36d391d987c1e29655aa3e32f7617883d225adxxxx
Amount: 350778sat
Status: invoice.set
Invoice: lnbc3499750n1pncgzz3pp5y2gt9jgjul5463cku7trmrf6tcurw6y7asj8ugmhmchufdjxnshqdp92d6kymtpwf5kuefq2dmkzupqveex7mfqgf2yxcqzzsxqyz57csp5hmde9aylmmwknvvafls8rvy9uefejx46kk0nq99pemencjeru3nq9p4gqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqysgqremn6xuur8dmq5j2akygxd2v488lv525sjjm0r76f94cyvywjee88sq03l6qputm5apymnad2z6hmxmw64d8s69galsplqqqxxxxxxxxx
Status: transaction.confirmed
Status: invoice.pending
Status: invoice.paid
Status: transaction.claim.pending
Status: transaction.claimed
Paid 453 sat onchain fee and 350 sat boltz fee
Checking the swap will result:
dev@lnbits00:~/boltz-client$ docker exec -ti boltz-client boltzcli listswaps
Type ID From To State Status Send Amount Boltz Fee Network Fee Created At
SUBMARINE zoZXkKI2b2cy BTC BTC SUCCESSFUL transaction.claimed 350778 350 453 2025-01-12T18:21:29Z
Automagically, when the transaction gets confirmed on the timechain, you will get the incoming payment
💵 Received 0.00349975 for “Submarine Swap from BTC” via WCC-BOUNCER
directly on your node! The magic happened:
If you enjoyed this articol, please share it, like and comment. I am at disposal and interested in your opinion.
Massimo is hard core. Not the type of stuff for your weekend bitcoiner ! The bitcoin takeover to reach the bitcoin standard!