Command hex format#717
Conversation
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
and implemented the trait for GetinfoResponse to have nice json outputs from glcli. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Sort out if we use the typical output or we print a json object. Use a macro to avoid code repetition. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Though this implementation is trivial, notice that this command's response is always failure when it should be success. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
|
Very good idea, the JSON output is likely more useful than the native protobuf serialization. However, I know that there are ways to add attributes to the structs that are generated in Rust. The App team had used it a while ago to convert arbitrary messages to JSON for their own logging. They were using the |
|
Let me know if you'd like to merge this as is, so the functionality is available, or whether you want to look into a more complex, but simpler longer term, solution :-) |
Added json outputs to
gl-clicommands.For example:
I did this by hand, for every possible gRPC response that we use, which are not all of CLN's commands.
I know this is flawed, since we have no guarantee of correctedness by developer error or API changes and
as the number of gRPC commands grow this task becomes tedious.
But right now it is manageable and until we find a trick to make it automatic we can use this.