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

feat(cast) cast wallet new - enable default keystore #9166

Open
radeksvarz opened this issue Oct 23, 2024 · 3 comments · May be fixed by #9201
Open

feat(cast) cast wallet new - enable default keystore #9166

radeksvarz opened this issue Oct 23, 2024 · 3 comments · May be fixed by #9201
Assignees
Labels
C-cast Command: cast good first issue Good for newcomers T-feature Type: feature

Comments

@radeksvarz
Copy link

Component

Cast

Describe the feature you would like

Currently the keystore must be explicitly declared if one wants to import new wallet key :

Usage: cast wallet new [OPTIONS] [PATH]

Arguments:
  [PATH]
          If provided, then keypair will be written to an encrypted JSON keystore

Proposal:
Add flag to import into default keystore when no PATH is given.

Additional context

No response

@radeksvarz radeksvarz added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Oct 23, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 23, 2024
@zerosnacks zerosnacks added C-cast Command: cast good first issue Good for newcomers and removed T-needs-triage Type: this issue needs to be labelled labels Oct 23, 2024
@kien6034
Copy link
Contributor

i would like to work on this

@HenryTabima
Copy link

Tell us about your background and how it can be leveraged: *

I am a software engineer with over 8 years of experience, passionate about open-source software and Web3 development. As a member of the Dojo coding community, I am eager to begin contributing to this project.

How would you approach the problem?

To implement the feature of importing keys into a default keystore without explicitly specifying [PATH], I would:

  1. Analyze Current Implementation: Understand how the cast wallet new command handles the [PATH] argument.

  2. Add Default Behavior:

  • Introduce a flag like --use-default to import keys into the default keystore when no [PATH] is given.
  • If [PATH] is provided, keep the current behavior.
  • Determine Default Location: Define a secure location for the default keystore (e.g., ~/.cast/keystore/). Ensure it's created if missing.
  1. Validation and Error Handling: Handle cases like missing permissions or failed writes, with clear error messages.

  2. Update Documentation: Modify help text and add examples for using the new default option.

  3. Testing: Write tests to verify:

  • Correct behavior with and without [PATH].
  • Proper handling of default import, permissions, and edge cases.

@zerosnacks
Copy link
Member

@kien6034 thanks! assigned this to you, let me know if you have any questions

@kien6034 kien6034 linked a pull request Oct 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast good first issue Good for newcomers T-feature Type: feature
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

5 participants
@radeksvarz @HenryTabima @kien6034 @zerosnacks and others