Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
117 stars 27 forks source link

Add rust based command line client #515

Closed nepet closed 1 month ago

nepet commented 2 months ago

This PR adds a rudimentary command line interface for gl-client written in rust. A cli in rust will ensure that we reflect changes in existing APIs onto the cli in the future.

Randy808 commented 2 months ago

I like the structure of this!

One suggestion, that don't need to be added in this PR, is giving a heads up to the user when they don't have a signer connected. One way to do this is with a timeout for cln methods that require a signer, followed by an error message that asks the user if they have a connected signer running.

The timeout doesn't need to cancel the request if there's a cln call we can't make a good maximum timeout for, but we can at least use the timeout to print a log to the console ('this call is taking longer than usual, please check that your signer is connected..., etc')

nepet commented 1 month ago

@Randy808 @cdecker Please let me know If you prefer passing the arguments of a node call via position or via flag. Compare connect or listpays with the other methods.

Randy808 commented 1 month ago

I prefer flags although generally my preference depends on the number of arguments on the method and the ratio of available arguments that are optional