If you are tired going through tutorials to connect bitcoind to lightning daemon then you are at the right place.
- docker-compose.yml
- bitcoin.conf
- lnd.conf
Uses a self validating v.23.0 bitcoind image as backend built from ruimarinho's docker-bitcoin-core
Lightning service uses the lnd's image
Do you have a running bitcoin node with data already? You can use it as a backend for your lightning node by mounting the data directory to the btc service in the docker-compose.yml file.
rpcuser
andrpcpassword
- to authenticate RPC calls. (Define your own user and password)rpcallowip=0.0.0.0/0
,rpcport=8332
,rpcbind=0.0.0.0
- from which ip addresses, through what port and on what address should bitcoind listen for RPC calls (Port is the default one, it binds to every network interface, and accepts connections from any ip as well)zmq*
block and transaction broadcasting configuration (port:ip)
bitcoin.node=bitcoind
use bitcoind as a backendbitcoind.rpchost=btc
the hostname where bitcoind listens, this is the name of the service in the compose filebitcoind.rpcuser=foo
,bitcoind.rpcpass=your_password
should be the same as in the bitcoin.conf filebitcoind.zmqpubrawblock=tcp://btc:28332
,bitcoind.zmqpubrawtx=tcp://btc:28333
should be the same as in the bitcoin.conf filebitcoind.dir=/root/.bitcoin
a directory containing bitcoin data, it will be mounted here via the compose file
tlsextraip=YOUR_IP_ADDRESS
the ip of your node (with port forward you can reach it from outside of your network, in that case your router's ip comes here)tlsextradomain=YOUR_IP_ADDRESS
same as above but with domain namesrpclisten=0.0.0.0:10009
tells LND to accept connections on all external interfaces on the default port (10009)
environment: - BITCOIN_DATA=/home/bitcoin/.bitcoin
where to store the bitcoin data inside the containervolumes: - ./bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
where to mount the bitcoin.conf file inside the containervolumes: - /your/path/to/bitcoin_data:/home/bitcoin/.bitcoin
where to store the bitcoin data directory on the host machine
volumes: - ./lnd.conf:/root/.lnd/lnd.conf
where to mount the lnd.conf file inside the containervolumes: - /your/path/to/bitcoin_data:/root/.bitcoin/
where to mount the bitcoin data directory inside the containervolumes: - /your/path/to/lnd:/root/.lnd/
where to store the lnd data directory on the host machinecommand:--noseedbackup
to disable the seed backup prompt for testing purposes (remove it if you want to be prompted for the seed backup)
volume: - /your/path/to/lnd:/root/.lnd/
where to mount the lnd data directory inside the container--host=YOUR_IP_ADDRESS
since we run it in a container we need to specify the host ip address to correctly generate the connection string
docker-compose up -d
to start the services, wait a for the bitcoind to sync with the blockchain (it can take a while)docker-compose -f lndconnect/docker-compose.yml up
to start the lndconnect service (it will generate a connection string for you to connect to your node via ZAP) (you can issue this command before the bitcoind syncs with the blockchain)