prusnak / suez

Tool for pretty printing and optimizing Lightning Network channels.
GNU General Public License v3.0
78 stars 20 forks source link

WIP Eclair support #1

Closed Kixunil closed 1 year ago

Kixunil commented 3 years ago

This change adds abstraction to enable multiple LN implementations and implements basic Eclair support. It is not yet capable of updating channel policy but can show all relevant channels.

I seek feedback for this change first. It's also a bit hackish, I mainly wanted to make basic features work with my node for starters.

prusnak commented 3 years ago

Overall, it looks nice!

I'd suggest splitting code into more files, such as channel.py, eclair.py, lnd.py, etc.

prusnak commented 3 years ago

I applied refactor similar to what you suggested in https://github.com/prusnak/suez/commit/62398ae4c33eaa2370a9c89a03ce2d73f12365ac

Not it should be much easier to add Eclair support by implementing EclairClient class in eclairclient.py.

ibz commented 2 years ago

Is there any progress on this? I just suggested in #31 to use RPC for lnd. I see this changeset does use RPC for Eclair. I would look into doing the same for lnd, but I'd rather wait for this to be merged first to avoid conflicts.

prusnak commented 2 years ago

This PR is abandoned for the time being. It already conflicts with master. Don't worry about creating more conflicts.

Kixunil commented 2 years ago

Damn, forgot about this. Would like to have support for Eclair. Will try to look into it during weekend.

ibz commented 2 years ago

@Kixunil It would be nice indeed! But I think more importantly we put a little work into extracting a common interface, if possible, so that individual implementations become even simpler and contain even less logic. I kinda did it in my last PR with lncli vs. lnd API, but they are both LND after all, so they are easy to abstract. It would be nice if we did it one level further even to accommodate other LN implementations.

If we do go that route, ideally we do LND+c-lightning first, since these are already supported, but of course Eclair must be kept in mind. Honestly I didn't look into Eclair, so I don't know. What do you think @prusnak? Alternatively, we can do LND+Eclair first and keep c-lightning in mind, to be switched to the common interface later on.

prusnak commented 2 years ago

Alternatively, we can do LND+Eclair first and keep c-lightning in mind, to be switched to the common interface later on.

Yes, we can always abstract things gradually.

Kixunil commented 2 years ago

@ibz agree with abstracting but I think proper abstracting will likely work with both so it doesn't matter which way you take. I do all such abstractions based on Clean Architecture, which is really nice and I recommend it (also recommend the book of the same name).

prusnak commented 1 year ago

I am closing this since this needs a massive refactor anyway and has been in WIP for a very long time. Feel free to reopen a new PR with the functionality!