Pre-configured, dockerized lightning network small cluster, using lnd and btcd in dev mode.
Use docker build to build the container images.
docker build -f Dockerfile.lnd -t eng/lnd .docker build -f Dockerfile.btcd -t eng/btcd .Use docker-compose to run the containers.
docker-compose up -dand to stop them
docker-compose downUse the command line to configure and manage the network nodes:
Create a new wallet
docker exec -ti alice /bin/sh -c "lncli --network=simnet create"and generate a new receiving address
docker exec alice /bin/sh -c "lncli --network=simnet newaddress np2wkh"update .env file with the newly generated address and then restart btcd
docker-compose up -dgenerate enough blocks for SegWit activation
docker exec btcd /bin/sh -c "btcctl --simnet --rpcuser=kek --rpcpass=kek --rpccert=/rpc/rpc.cert --rpcserver=localhost generate 400"
docker exec btcd /bin/sh -c "btcctl --simnet --rpcuser=kek --rpcpass=kek --rpccert=/rpc/rpc.cert --rpcserver=localhost getblockchaininfo | grep segwit -A 1"
docker exec alice /bin/sh -c "lncli --network=simnet walletbalance"docker exec -ti bob /bin/sh -c "lncli --network=simnet create"Get "Bob" identity pubkey
docker exec -ti bob /bin/sh -c "lncli --network=simnet getinfo | grep identity_pubkey"and IP address
docker inspect bob | grep IPAddressconnect Alice to Bob node
docker exec alice /bin/sh -c "lncli --network=simnet connect <node key>@<node ip>"verify the connection on both sides
docker exec alice /bin/sh -c "lncli --network=simnet listpeers"
docker exec bob /bin/sh -c "lncli --network=simnet listpeers"create the channel
docker exec alice /bin/sh -c "lncli --network=simnet openchannel --node_key=<node key> --local_amt=1000000"
docker exec btcd /bin/sh -c "btcctl --simnet --rpcuser=kek --rpcpass=kek --rpccert=/rpc/rpc.cert --rpcserver=localhost generate 3"
docker exec alice /bin/sh -c "lncli --network=simnet listchannels"Generate the invoice
docker exec bob /bin/sh -c "lncli --network=simnet addinvoice --amt=10000"From the output, copy the payment request and then send the payment
docker exec -ti alice /bin/sh -c "lncli --network=simnet sendpayment --pay_req=<payment request>"Check balances
docker exec alice /bin/sh -c "lncli --network=simnet channelbalance"
docker exec bob /bin/sh -c "lncli --network=simnet channelbalance"Follow Working with LND and Docker for more.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.