Container image #2: bitcoin core with sqlite3 wallet enabled + lightning core 24.02.2branch home + extra info:
https://github.com/mocacinno/btc_testnet4/tree/bci_lightningThis image contains bitcoin core, with the pull request for testnet4 applied and lightning core 24.02.2.
This one is a little bit "odd". I decided to split services into seperate containers as much as possible, but lightning core is so intertwained with bitcoin core, it was to hard to seperate them into different containers... So bitcoin core and lightning core are bundled...
This being said, it's still pretty easy to run. The prereqs are
- a linux host, running docker
- a path to store the persistent bitcoin core data (blocks, wallets,...)
- a path to store the persistent lightning core data
Once you have these, just copy this docker-compose.yml file on your local system:
https://raw.githubusercontent.com/mocacinno/btc_testnet4/bci_lightning/docker-compose.ymlmodify the docker-compose.yml (for example, change the user, password, port and LOCAL paths). Then run
Now, i did notice that lightningd does not always start properly... It might be necessary to enter the container and actually start lightningd yourself
docker exec -it bitcoind /bin/bash
lightningd --plugin-dir /opt/lightningd/plugins/ --bitcoin-datadir /root/.bitcoin/testnet4 --bitcoin-rpcuser demo --bitcoin-rpcpassword demo --bitcoin-rpcconnect 127.0.0.1 --bitcoin-rpcport 5000 --testnet --log-file=/tmp/lightning.log --daemon
once your lightning daemon is running, the fun can start
docker exec -it bitcoind /bin/bash
lightning-cli --testnet getinfo
lightning-cli --testnet listunspent
#create a new address
lightning-cli --testnet newaddr
#FUND this address, tx needs 6 confirms to show up!!!
#check funds
lightning-cli --testnet listfunds
#connect to a second lightning node on testnet4
lightning-cli --testnet connect 02dcee61e0aecb430296c5129bc2f07e5ccf791ac408389443d30333e6eaba52c9@54.38.124.151
#create (and fund) the channel
lightning-cli --testnet fundchannel 02dcee61e0aecb430296c5129bc2f07e5ccf791ac408389443d30333e6eaba52c9 200000 urgent true 1
#create an invoice
lightning-cli --testnet invoice 5000 pay500 demo 3600
#copy the bolt11 value
#pay the invoice
lightning-cli --testnet pay lntb50n1pn9p9npsp5zf6tyfhcthxry9e3ueax4ccwgwj459ypvuuut65pckwt0wx0k6eqpp5hkzd9x2wy69pznyrlfck3ey7g96canuflr7lqq2ru5guy3xhe7uqdq8v3jk6mccqp29qxpqysgq2zz9ac35rh6rla8tdl627jwpfaltl39qufrg5eewpw9flldcl8kjum30r9g3zj6ltd23qa85ccanzup367vm5l0qq2szpff2fs5xndgqa0674s
lightning-cli --testnet listunspent
If you don't trust me (and eventough i personally think i'm trustworthy, i have never given you any reason to actually trust me), you can build the image all by yourself aswell... Just use my dockerfile:
https://raw.githubusercontent.com/mocacinno/btc_testnet4/bci_lightning/DockerfileOpen it, read what i did, and once you verified that i did a good thing, execute
docker build -t whatever_image_name_you_want:whatever_tag_you_want .
then use the docker-compose.yml i provided and change the image name, user, pass,... and run