-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --json flag to force JSON output in relayer CLI #500
Comments
Maybe also take into consideration the following problem highlighted elsewhere (in #469): Sort-out error messages and make them consistent. For example, updating a non-existing client results in a panic, but querying for a non-existing client returns an error. The commands are:
|
Agreed! On top of that, we should also return a proper UNIX error code on exit, via |
I'm thinking we should make |
I like the way the tx CLIs return the result of the transaction, decoded with the interesting information. It would be nice to include that. For example channel
Or |
Sounds good. So, should we say that:
This would allow us to pipe the relayer stdout to What do you think? |
If we stick with the What remains to be seen is if that's doable with Abscissa, |
I like the idea of configuring the output format at runtime. After a bit of digging, Abscissa has support for But to focus on @andynog's work on CI, I'm curious what's important there..
|
Both
Probably not
Yes, for example IDs should be extracted from the init/ create Tx results and used in subsequent CLIs. Verification should also issue query commands and check fields from the output. |
Since Andy is working on CI already, can we just default everything to json for now and we look at a nicer output for us/ human users later? The json output is actually not too bad. |
I agree that Json output for tx and query should be the default. Eventually we might have a better configurable logging mechanism (support multiple log outputs and formats). But for now, automating things will be easier I believe using Json and is the way to go. It's easier to programmatically extract values then trying to parse text which is difficult and error prone. |
Crate
relayer-cli
Summary
Add a
--json
flag to force JSON output in all the CLI commands.Problem Definition
Why do we need this?
Proposal
--json
flag to all commands, which enables JSON output.status_ok!
,status_info!
andstatus_err!
macros but instead emit a single-line JSON-encoded message.status
field which must be set to one of"success"
,"info"
, or"error"
.msg
field with a human-readable description of the result of the command.Example:
For Admin Use
The text was updated successfully, but these errors were encountered: