prusnak / suez

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

Use RPC instead of lncli #31

Closed ibz closed 1 year ago

ibz commented 2 years ago

It would be very nice to use the RPC API provided by lnd rather than relying on lncli being installed. I am trying to run suez in a Docker container and I'd rather not install lncli when it could directly communicate over RPC with lnd from another container.

I saw that that the choice of backend is abstracted away in separate classes, one for lnd and one for c-lightning. So in theory I could just add another one for RPC. Did somebody already look into that? Or is there some good reason to rely on lncli?

prusnak commented 2 years ago

I would love to merge the PR which replaces the calls to lncli with calls to RPC API. Are you up for the task?

ibz commented 2 years ago

Sent a PR.

I preferred to not replace the lncli calls with REST API calls, because some people might still have scripts that depend on the old version's defaults.

In the future you could easily drop support for the lncli option and have lnd-rest be the default. In theory it should not bother anyone, because anyone that has access to lncli needs also to have access to the tls cert and the macaroon. But you never know... so for now I thought it's better to just add a new client and keep the defaults as they are.

prusnak commented 1 year ago

Implemented some time ago (via REST API) but forgot to close this one.