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

[v0.2.0] Major CLI Refactor / Cleanup #127

Merged
merged 3 commits into from
Aug 14, 2024
Merged

[v0.2.0] Major CLI Refactor / Cleanup #127

merged 3 commits into from
Aug 14, 2024

Conversation

jbrower95
Copy link
Contributor

@jbrower95 jbrower95 commented Aug 14, 2024

  • Moved commands to the /command package
  • Deprecated --proof and --output -- we now just output calldata to stdout as JSON by default. If you want to save to a file, pipe the JSON output to a file, and later use a tool like foundry's cast to submit :)
  • Cleaned up argument parsing, so main.go isn't a mess.

Workflows:

  • If you want graphical interaction and to auto write to network, supply --sender <privateKey>.
  • If you want to submit your proofs later, don't provide --sender and instead just parse the JSON output from the command -- we provide to and calldata, sign this with whatever tool you want and submit to network.
  • If you need more information about any of this, pass --verbose.
  • With --sender, If you want to submit any of this in CI without user prompts, pass --no-prompt.

Hopefully this simplifies everyone's workflows!

Examples

credential proofs
image

checkpoint start
image

@jbrower95 jbrower95 marked this pull request as ready for review August 14, 2024 03:09
Usage: "Print the calldata for all associated transactions, but do not execute them. Note that some transactions have an order dependency (you cannot submit checkpoint proofs if you haven't started a checkpoint) so this may require you to get your pod into the correct state before usage.",
Required: false,
Destination: &simulateTransaction,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is now just the default state of the tool.

Copy link
Contributor

@wadealexc wadealexc left a comment

Choose a reason for hiding this comment

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

image

Expanding pubkeys by default makes output a touch more annoying to deal with. Maybe we could use a flag for this?

cli/main.go Show resolved Hide resolved
Comment on lines +53 to +55
if !args.NoPrompt && !args.SimulateTransaction {
core.PanicIfNoConsent(core.StartCheckpointProofConsent())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do the inverse of this boolean statement?

if args.NoPrompt || args.SimulateTransaction

The current version is making my head hurt :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dam this is what i get for coding past 11

@jbrower95 jbrower95 merged commit c827ba5 into master Aug 14, 2024
3 checks passed
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.

2 participants