ElementsProject / lightning-charge

A simple drop-in solution for accepting lightning payments
MIT License
553 stars 80 forks source link

Docker container stops on boot using latest version of charged #79

Closed robertclarkson closed 3 years ago

robertclarkson commented 3 years ago

Hi my docker compose service looks like this:

lightning-charged:
    restart: always
    image: shesek/lightning-charge:0.4.19
    environment:
      NETWORK: mainnet
      API_TOKEN: ${CHARGED_API_TOKEN}
      LN_ALIAS: ${CHARGED_ALIAS}
      LIGHTNINGD_OPT: "--bind-addr=127.0.0.1:9735 --announce-addr=${CHARGED_IP}"
      VIRTUAL_NETWORK: nginx-proxy
      VIRTUAL_PORT: 9112
      VIRTUAL_HOST: ${CHARGED_HOST}
      # Let's encrypt settings
      # LETSENCRYPT_HOST: ${CHARGED_HOST}
      # LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-yourname@example.com}
      # SKIP_BITCOIND: 1
      BITCOIND_URI: $BITCOIN_URI
      # LN_PATH: /etc/lightning
    volumes:
      - "charged_datadir:/data"
      # - "clightning_bitcoin_datadir:/etc/lightning"
    expose:
      - "9112"
    ports:
      - "9112:9112" # Charge
      - "9735:9735" # Lightning

I get the log message

lightning-charged_1  | Connecting to bitcoind at 192.168.10.2:8332... waiting for RPC... ready.

But then doesnt load clightning.

if i use container version 0.3.15 then it works but i'm on a super old version of lightning.

Can anyone help? Thanks

robertclarkson commented 3 years ago

Further to this, the most recent version i can get to load is 0.4.13

If i use 0.4.16 i get

lightning-charged_1  | Connecting to bitcoind at 192.168.10.2:8332... waiting for RPC... ready.
lightning-charged_1  | Starting lightningd... waiting for RPC unix socket... Refusing to migrate down from version 129 to 128
shesek commented 3 years ago

I was able to get your docker-compose to work the latest version (v0.4.22). I didn't try with v0.4.19, is there a particular reason you're using it?

You can try running docker exec -it <id> tail -f /data/lightning/regtest/debug.log to see c-lightning logs, which might provide a hint.

I would, however, recommend to use a separate container for c-lightning and use the shesek/lightning-charge:standalone docker image (comes with lightning charge only, without bitcoind/lightningd). The c-lightning version that comes bundled with charge is behind by 4 versions, which is quite significant in the lightning world.

I will look into updating the bundled c-lightning, but you're probably still better off using it directly so you'll get updates sooner.

If you're looking for more of an all in-one-one solution, I have another project coming up that might be relevant. It won't include lightning charge initially, but its high on the priority list. Will send a ping here when its released.

shesek commented 3 years ago

The bundled c-lightning was updated to the latest release (v0.9.3).

Closing this for now, please report back if you're still having issues.