lightninglabs / loop

Lightning Loop: A Non-Custodial Off/On Chain Bridge
MIT License
558 stars 116 forks source link

loopd start error #746

Closed jimtracy1007 closed 5 months ago

jimtracy1007 commented 5 months ago

After I started using ./regtest.sh start, I called ./regtest.sh loop out --amt 500000 --fast, and the error was reported: [loop] rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 192.168.16.6:11009: connect: connection refused"

services:
  bitcoind:
    image: ruimarinho/bitcoin-core:23
    container_name: bitcoind
    restart: unless-stopped
    networks:
      regtest:
        aliases:
          - bitcoind
    command:
      - "-txindex"
      - "-regtest"
      - "-rest"
      - "-printtoconsole"
      - "-zmqpubrawblock=tcp://0.0.0.0:28332"
      - "-zmqpubrawtx=tcp://0.0.0.0:28333"
      - "-rpcport=18443"
      - "-rpcbind=0.0.0.0"
      # This is just the hashed string "lightning" with a salt.
      - "-rpcauth=lightning:8492220e715bbfdf5f165102bfd7ed4$$88090545821ed5e9db614588c0afbad575ccc14681fb77f3cae6899bc419af67"
      - "-rpcallowip=0.0.0.0/0"
      - "-fallbackfee=0.0002"
      - "-peerblockfilters=1"
      - "-blockfilterindex=1"
      - "-wallet=/home/bitcoin/.bitcoin/regtest/wallets/miner"
    environment:
      - HOME=/home/bitcoin
    volumes:
      - bitcoind:/home/bitcoin/.bitcoin

  lndserver:
    image: lightninglabs/lnd:v0.17.0-beta
    container_name: lndserver
    restart: unless-stopped
    networks:
      regtest:
        aliases:
          - lndserver
    volumes:
      - "lndserver:/root/.lnd"
    depends_on:
      - bitcoind
    command:
      - "--logdir=/root/.lnd"
      - "--alias=lndserver"
      - "--rpclisten=0.0.0.0:10009"
      - "--noseedbackup"
      - "--bitcoin.active"
      - "--bitcoin.regtest"
      - "--bitcoin.node=bitcoind"
      - "--bitcoind.rpchost=bitcoind"
      - "--bitcoind.rpcuser=lightning"
      - "--bitcoind.rpcpass=lightning"
      - "--bitcoind.zmqpubrawblock=tcp://bitcoind:28332"
      - "--bitcoind.zmqpubrawtx=tcp://bitcoind:28333"
      - "--debuglevel=debug"
      - "--externalip=lndserver"
      - "--tlsextradomain=lndserver"

  loopserver:
    image: lightninglabs/loopserver
    container_name: loopserver
    restart: unless-stopped
    networks:
      regtest:
        aliases:
          - loopserver
    volumes:
      - "lndserver:/root/.lnd"
    depends_on:
      - lndserver
    command:
      - "daemon"
      - "--maxamt=5000000"
      - "--lnd.host=lndserver:10009"
      - "--lnd.macaroondir=/home/loopserver/"
      - "--lnd.tlspath=/home/loopserver/tls.cert"
      - "--bitcoin.host=bitcoind:18443"
      - "--bitcoin.user=lightning"
      - "--bitcoin.password=lightning"
      - "--bitcoin.zmqpubrawblock=tcp://bitcoind:28332"
      - "--bitcoin.zmqpubrawtx=tcp://bitcoind:28333"

  lndclient:
    image: lightninglabs/lnd:v0.17.0-beta
    container_name: lndclient
    restart: unless-stopped
    networks:
      regtest:
        aliases:
          - lndclient
    volumes:
      - "lndclient:/root/.lnd"
    depends_on:
      - bitcoind
    command:
      - "--logdir=/root/.lnd"
      - "--alias=lndclient"
      - "--rpclisten=0.0.0.0:10009"
      - "--noseedbackup"
      - "--bitcoin.active"
      - "--bitcoin.regtest"
      - "--bitcoin.node=bitcoind"
      - "--bitcoind.rpchost=bitcoind"
      - "--bitcoind.rpcuser=lightning"
      - "--bitcoind.rpcpass=lightning"
      - "--bitcoind.zmqpubrawblock=tcp://bitcoind:28332"
      - "--bitcoind.zmqpubrawtx=tcp://bitcoind:28333"
      - "--debuglevel=debug"
      - "--externalip=lndclient"
      - "--tlsextradomain=lndclient"

  loopclient:
    image: loopd
    container_name: loopclient
    build:
      context: ../
      dockerfile: Dockerfile
    restart: unless-stopped
    networks:
      regtest:
        aliases:
          - loopclient
    volumes:
      - "lndclient:/root/.lnd"
    depends_on:
      - lndclient
    command:
      - "loopd"
      - "--network=regtest"
      - "--debuglevel=debug"
      - "--server.host=loopclient:11009"
      - "--server.notls"
      - "--lnd.host=lndclient:10009"
      - "--lnd.macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
      - "--lnd.tlspath=/root/.lnd/tls.cert"
    expose:
      - "8081"
      - "11010"
      - "11009"
    ports:
      - "8081:8081" # If needed
      - "11010:11010" # If needed
      - "11009:11009" # Definitely needed based on your error
networks:
  regtest:

volumes:
  bitcoind:
  lndserver:
  lndclient:

This is the config

bhandras commented 5 months ago

There are two things, for the server you'll also need --network=regtest, and I believe that your --server.host=loopclient:1100 for the loopclient is wrong as that should point to the address and port of the loop server.

jimtracy1007 commented 5 months ago

`> There are two things, for the server you'll also need--network=regtest, and I believe that your--server.host=loopclient:1100` for the loopclient is wrong as that should point to the address and port of the loop server.

You mean change loopclient config like this?

depends_on:
     - lndclient
     -lndserver
 - "--server.host= lndserver:11009"

?

jimtracy1007 commented 5 months ago

There are two things, for the server you'll also need --network=regtest, and I believe that your --server.host=loopclient:1100 for the loopclient is wrong as that should point to the address and port of the loop server.

Thank you for your suggestion. I can already run it. I think the docker-compose.yml in the master branch should fix this issue, otherwise it will be very unfriendly to beginners. Thank you