fusion44 / blitz_api

A management backend for the RaspiBlitz project written in Python / FastAPI
MIT License
19 stars 18 forks source link

All Endpoints: add implementation for Core Lightning #45

Closed cstenglein closed 2 years ago

cstenglein commented 2 years ago

@rootzoll important issue

Currently, the API only provides support for lnd. As a user I would like to have the webui handle c-lightning as well.

rootzoll commented 2 years ago

@fusion44 is there already a BlitzAPI config for core lightning allready I can prepare the RaspiBlitz for?

This is were I will insert the auto-configuration in the blitz.web.api.sh script: https://github.com/rootzoll/raspiblitz/blob/2853c104067c4ef389d83412df7184467ee7fd23/home.admin/config.scripts/blitz.web.api.sh#L170

fusion44 commented 2 years ago

Yes you can: https://github.com/fusion44/blitz_api/blob/cln/.env_sample#L86

I'll add some more comments tomorrow evening.

fusion44 commented 2 years ago

@cstenglein There are two small breaking changes hidden in the last commit to CLN branch. Invoice's add_index field is now a string because CLN's label field are strings. These changes affect add-invoice and list-invoices.

    add_index: str = Query(
        ...,
        description="""
The index of this invoice. Each newly created invoice will increment this index making it monotonically increasing.
CLN and LND handle ids differently. LND will generate an auto incremented integer id, while CLN will use a user supplied string id.
To unify both, we auto generate an id for CLN and use the add_index for LND.

For `LND` this will be an `integer` in string form. This is auto generated by LND.

For `CLN` this will be a `string`. If the invoice was generated by BlitzAPI, this will be a
[Firebase-like PushID](https://firebase.blog/posts/2015/02/the-2120-ways-to-ensure-unique_68).
If generated by some other method, it'll be the string supplied by the user at the time of creation of the invoice.
""",
    )

Also I've removed value in favor for value_msat.

cstenglein commented 2 years ago

@fusion44 I don't currently use it=> no breaking change :)