Skip to content
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 encode-content-key command to trin-cli #300

Merged
merged 2 commits into from May 24, 2022

Conversation

jacobkaufmann
Copy link
Collaborator

@jacobkaufmann jacobkaufmann commented Apr 8, 2022

What was wrong?

We lack a CLI command to encode content keys, which makes it difficult to interact with the network from the CLI if you want to look up content items.

How was it fixed?

  • Split up top-level StructOpt into two commands:
    • json-rpc initiates JSON-RPC requests
    • encode-key encodes content keys
  • Move help descriptions from attributes to doc comments.
  • Define encode-key subcommand to encode content keys.
    • Support encoding for history content types.
    • Each content type is its own subcommand under encode-key.
      • There is some repetition here, but I think it makes the interface more intuitive.
  • Update getting started docs.
    • Update existing JSON-RPC commands.
    • Add section for encoding content keys.

To-Do

  • Add entry to the release notes (may forgo for trivial changes)
  • Clean up commit history

@jacobkaufmann jacobkaufmann force-pushed the trin-cli-content-key branch 3 times, most recently from 9f927b1 to 36a3c82 Compare April 14, 2022 14:11
@jacobkaufmann jacobkaufmann marked this pull request as ready for review April 14, 2022 14:22
Copy link
Collaborator

@mrferris mrferris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, works great 👍

@jacobkaufmann
Copy link
Collaborator Author

@carver do you want to take a look? Given that you seem to have a use case for this utility, I would like to see how well it meets your needs.

@carver
Copy link
Collaborator

carver commented May 20, 2022

@carver do you want to take a look? Given that you seem to have a use case for this utility, I would like to see how well it meets your needs.

A lot of it was just curiosity, and it ended up being pretty straightforward to just generate in python after a quick spec review. But I'm still happy to take a look!

Copy link
Collaborator

@carver carver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, all looks reasonably to me!

@@ -52,13 +52,13 @@ cargo run
Note: You may also pass environment variable values in the same command as the run command. This is especially useful for setting log levels.

```sh
RUST_LOG=debug cargo run -p trin
RUST_LOG=debug cargo run
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea the history here of why it used to be -p trin?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but the two commands are identical, so I prefer the more succinct one. I wish I could remember if I even had a reason to change that in the first place 🤔.

docs/getting_started.md Outdated Show resolved Hide resolved
newsfragments/300.added.md Outdated Show resolved Hide resolved
@carver
Copy link
Collaborator

carver commented May 20, 2022

Obviously, after the build errors are fixed 😆

@jacobkaufmann jacobkaufmann merged commit 24efe2e into ethereum:master May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants