/lnd-docker

Primary LanguageDockerfile

lnd docker

container

start

# from host
./compose.sh up [-d]

stop

# from host
./compose.sh down [-v]

login

bitcoind

# from host
docker exec -it lnd-docker-mybitcoind-1 /bin/sh
# from container
bitcoin-cli -datadir=/data/.bitcoin -regtest getblockcount
# from host
curl --user rpcuser:rpcpass  --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

lnd

# from host
docker exec -it lnd-docker-mylnd1-1 /bin/sh
# from container
lncli -n regtest --lnddir=/data/lnd getinfo

add new lnd client

add mylndx

  1. docker-compose.yml
  2. copy mylnd1 and paste as mylndx.
  3. replace lnd-data1 to lnd-datax in mylndx.volumes section.
  4. replace ./lnddata/data2:/mnt to ./lnddata/datax:/mnt in mylndx.volumes section.
  5. add sleep 1d && to lnd-datax.entrypoint section after mkdir line.
  6. edit lnd-datax.ports section to avoid duplication with others.
  7. add lnd-datax to root volumes section.
  8. run mkdir lnddata/datax
  9. run ./compose.sh up
  10. run docker exec -it lnd-docker-mylndx-1 /bin/sh
  11. run lnd --configfile=/data/lnd.conf --lnddir=/data/lnd > /dev/null&
  12. run cp /data/lnd/tls.* /mnt/
  13. run cd /data/lnd/data/chain/bitcoin/regtest/ && cp admin.macaroon macaroons.db wallet.db /mnt/
  14. run exit
  15. run ./compose.sh down -v
  16. edit docker-compose.yml and remove sleep line.

initialize

Generate 101 blocks and reward to 'lnd-docker-lnd-1' address.

curl --user rpcuser:rpcpass  --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "generatetoaddress", "params": [101, "bcrt1q4zhf82t39pfh4zsdv3r8n3ljc32mzx4x64r6fa"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/