-
Notifications
You must be signed in to change notification settings - Fork 103
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
feat(x/data/v2/client)!: add generate-iri command #2190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I've gone ahead and completed the following tests:
- try
file-iri
with a.jsonld
file - try
file-iri
with another non RDF file - try
convert-iri-to-hash
with some IRI - try
convert-hash-to-iri
with some hash
Two questions / suggestions I have:
- Is there another command name you were considering besides
regen q data file-iri
? It's not the most clear IMO, but I'm not sure if I could think of a better one... When initially thinking about this, part of me wanted these utility CLI functions to be outside of thequery
subcommand entirely, as they aren't actually querying for any on-chain data. Something likeregen utils iri-from-file
orregen iri-from-file
orregen utils file-to-iri
? - when running
regen q data convert-iri-to-hash
it only provides output as as YAML/text. can you add the--output
flag so that one can set output as JSON? This would make it easier to convert back to an IRI via the correspondingconvert-hash-to-iri
function?
The command already has a -o option. |
With other See below: $ regen q data resolver --help
Query a resolver by its unique identifier.
Usage:
regen query data resolver [id] [flags]
Examples:
regen q data resolver 1
Flags:
--grpc-addr string the gRPC endpoint to use for this chain
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS
--height int Use a specific height to query state at (this can error if the node is pruning state)
-h, --help help for resolver
--node string <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
-o, --output string Output format (text|json) (default "text")
Global Flags:
--chain-id string The network chain ID
--home string directory for config and data (default "/Users/cory/.regen")
--log_format string The logging format (json|plain) (default "plain")
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
--trace print out full stack trace on errors versus $ regen q data convert-iri-to-hash --help
Convert an IRI to a ContentHash.
Usage:
regen query data convert-iri-to-hash [iri] [flags]
Examples:
regen q data convert-iri-to-hash regen:13toVfvC2YxrrfSXWB5h2BGHiXZURsKxWUz72uDRDSPMCrYPguGUXSC.rdf
Flags:
-h, --help help for convert-iri-to-hash
Global Flags:
--chain-id string The network chain ID
--home string directory for config and data (default "/Users/cory/.regen")
--log_format string The logging format (json|plain) (default "plain")
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
--trace print out full stack trace on errors |
Oh, that's a regression. Try now |
Also we can call this something besides |
Keeping it all within query commands sounds good 👍. I do think it'd be nice then to update the description of data query commands (e.g. the display text for Currently it just says "Query commands for the data module." Which to me implies that all sub commands query the blockchain. As for names of the file subcommand, I prefer something that describes the relation btw file & iri. So either |
Can you just pick a name and I'll update the PR? |
Let's do |
Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Description
Closes: #XXXX
Testing instructions:
generate-iri
with a.jsonld
filegenerate-iri
with another non RDF fileconvert-iri-to-hash
with some IRIconvert-hash-to-iri
with some hashAuthor Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change