version: "3"

services:
  lnd_litecoin:
    image: btcpayserver/lnd:v0.11.0-beta
    container_name: btcpayserver_lnd_litecoin
    restart: unless-stopped
    environment:
      LND_CHAIN: "ltc"
      LND_EXTERNALIP: ${BTCPAY_ANNOUNCEABLE_HOST}
      LND_PORT: 9736
      LND_ALIAS: ${LIGHTNING_ALIAS}
      LND_ENVIRONMENT: "${NBITCOIN_NETWORK:-regtest}"
      LND_READY_FILE: /root/.nbxplorer/ltc_fully_synched
      LND_EXTRA_ARGS: |
        restlisten=0.0.0.0:8080
        rpclisten=127.0.0.1:10008
        rpclisten=0.0.0.0:10009
        litecoin.node=litecoind
        litecoind.rpchost=litecoind:43782
        litecoind.zmqpubrawblock=tcp://litecoind:28332
        litecoind.zmqpubrawtx=tcp://litecoind:28333
        adminmacaroonpath=/data/admin.macaroon
        invoicemacaroonpath=/data/invoice.macaroon
        readonlymacaroonpath=/data/readonly.macaroon
        notls=1
    ports:
      - "9736:9736"
    expose:
      - "8080"
      - "9736"
    volumes:
      - "lnd_litecoin_datadir:/data"
      - "litecoin_datadir:/deps/.litecoin"
      - "nbxplorer_datadir:/root/.nbxplorer"
    links:
      - litecoind

  btcpayserver:
    environment:
      BTCPAY_LTCLIGHTNING: "type=lnd-rest;server=http://lnd_litecoin:8080/;macaroonfilepath=/etc/lnd_litecoin/admin.macaroon;allowinsecure=true"
      BTCPAY_LTCEXTERNALLNDSEEDBACKUP: "/etc/lnd_litecoin/data/chain/litecoin/${NBITCOIN_NETWORK:-regtest}/walletunlock.json"
    volumes:
      - "lnd_litecoin_datadir:/etc/lnd_litecoin"
    links:
      - lnd_litecoin

volumes:
  lnd_litecoin_datadir:

required:
  - "opt-add-zmq"
