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

Generate default name when using account import #2581

Open
franciszekjob opened this issue Oct 15, 2024 · 8 comments · May be fixed by #2610
Open

Generate default name when using account import #2581

franciszekjob opened this issue Oct 15, 2024 · 8 comments · May be fixed by #2610
Assignees
Labels
feature New feature request/description ODHack9 Label for tasks to be done in the ODHack October sncast

Comments

@franciszekjob
Copy link
Collaborator

franciszekjob commented Oct 15, 2024

Which component is your feature related to?

Cast

Feature Request

When using account import we should be able to use it without passing name which is currently required. Cast should use default (available) or automatically generated name.

Current usage

sncast account import \
    --name abc111 \
    --address 0x1bbc22958cbc7a37bf8d787fc693ec296c0f46834fe6027054e3fb47d3edf75 \
    --private-key 0x1 \
    --type oz  \
    --url http://127.0.0.1:5050/rpc

Usage after implementation

sncast account import \
    --address 0x1bbc22958cbc7a37bf8d787fc693ec296c0f46834fe6027054e3fb47d3edf75 \
    --private-key 0x1 \
    --type oz  \
    --url http://127.0.0.1:5050/rpc

Both command such succeed with such output:

command: account import
add_profile: --add-profile flag was not set. No profile added to snfoundry.toml
@franciszekjob franciszekjob added this to the Cast UX improvements milestone Oct 15, 2024
@cptartur cptartur added feature New feature request/description and removed new labels Oct 17, 2024
@franciszekjob franciszekjob added the ODHack9 Label for tasks to be done in the ODHack October label Oct 21, 2024
@JoE11-y
Copy link

JoE11-y commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Joseph a blockchain developer with over four years in blockchain and backend development, I’ve worked across different ecosystems, handling everything from smart contract design to on-chain interactions and protocol integration. I focus on building secure, scalable, and reliable blockchain applications, managing both on-chain and off-chain infrastructure.

How I plan on tackling this issue

Begin by studying the codebase to ensure design consistency, then proceed to work on the task.

  1. Study current codebase design
  2. implement the default name feature.
  3. Performs tests to ensure that feature works as intended and no other feature is affected.
  4. And lastly optimize.

@CollinsC1O
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello I'm a front-end and a blockchain developer and will love to work on this

@PoulavBhowmick03
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Poulav Bhowmick, a Starknet Wolf. I am a software engineer at Invisible Studios, and a blockchain engineer with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet, Ethereum, Stellar ecosystem.

How I plan on tackling this issue

I will modify the sncast account import command to allow users to import accounts without specifying a name. When the --name flag is omitted, Cast will be generating a default name using a combination of the first few characters of the account address (e.g., account_0x1bbc) or a timestamp-based unique identifier if the address is not available. will ensure that this generated name does not conflict with any existing profiles. The implementation will ensure that the current functionality is preserved for users who prefer to pass their own name using the --name flag. also, i will update the user feedback message to reflect whether a default name was generated or a custom name was used, and write test cases to validate this new behavior. will also be updating the docs
ETA - 3 days

@DanielEmmanuel1
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello there, my name is Deon and I’m a Full-Stack web3 developer with a burning passion for building efficient and reliable software.

I have experience in various Rust ecosystems and enjoy tackling challenges that help improve code quality and user experience. My background includes working on open-source projects OD Hack included, as well as contributing to community discussions, and continuously learning about the latest advancements in Rust.

How I plan on tackling this issue

  • I will start by reviewing the existing code for the sncast account import command to understand how the name argument is processed.

  • After that I’ll adjust the argument parsing to make the --name argument optional, implementing logic to either use a default name or generate one automatically.

  • Next up will be to conduct thorough testing to ensure that the command works as expected without the name and handles cases where a name is still provided.

  • Finally I’ll update the necessary documentation to reflect my changes, making it clear that the --name argument is now optional.

  • Once done with make the fixes, I'll create a pull request with the changes and detailed explanations for review.

Once again I’m really excited about the opportunity to build and contribute to this repo as well as being part of a product solving real time issues with blockchain tech. I'm excited to hear from you and can't wait to get started

@khayss
Copy link

khayss commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m an experienced Rust developer with a background in blockchain and open-source contributions. I’ve worked on several Rust-based projects.

How I plan on tackling this issue

To allow account import without requiring a name, I will:

  1. Modify the account import functionality to make the name parameter optional.
  2. Implement logic to automatically generate a default name if none is provided. This could be based on available names or an incremented naming convention (e.g., account_1, account_2).
  3. Ensure the new logic checks for existing names to avoid duplicates.
  4. Test the updated functionality to ensure accounts are successfully imported and assigned default names without issues.
  5. Review and update any related documentation or test cases to reflect this change.

I’m eager to contribute to this feature and would appreciate the opportunity to be considered for this issue.

@od-hunter
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, please can I be assigned this please? This would be my first time contributing to this project and I would love to be the given the opportunity to contribute. I have experience in html, css, JavaScript,TypeScript and solidity, and Cairo.

How I plan on tackling this issue

To solve this issue, I’ll take the following steps:
1.⁠ ⁠I’ll modify Modify sncast account import, where by I’ll make the --name flag optional, and if no name is provided, generate a default name (e.g., account_1, account_2, etc.).
2.⁠ ⁠⁠I’ll automatically assign a default name if --name is omitted, based on existing accounts.
3.⁠ ⁠⁠I’ll ensure the command works with or without the --name argument and If no name is given, I’ll set an output a message like: "No name provided, using default name: account_1."
4.⁠ ⁠⁠Then I’ll test both cases (with and without --name), ensuring no conflicts with existing accounts. ⁠I’ll update the snfoundry.toml profile unless the --add-profile flag is omitted.

Please assign me, I’m ready to work.

@MrRoudyk
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Software Engineer with 10 years of experience. For the past 5 years, I’ve specialized in HR Tech solutions, now used by tens of thousands of companies and hundreds of thousands of users. I have also contributed to open source development at OnlyDust (My OnlyDust Profile).

I’m passionate about exploring new technologies and currently looking to deepen my expertise in blockchain, smart contracts, and decentralized applications.

How I plan on tackling this issue

I will start by changing how arguments are handled in the Cast component, making the --name parameter optional. If the name is not provided, I will generate it automatically based on the address or another unique identifier. Then, I will update the account import logic to handle both cases: with a name and without. I will test both versions of the command. Finally, I will update the documentation to show the changes.

@suhas-sensei
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i have experience in cairo and blockchain previously as personal projects and OS, so hoping to make use of them here and mark my first odhack contribution.

How I plan on tackling this issue

Add import of the intelligent name generation sys in cast's account, using for uniqueness chain ID and addy prefix like goerli_1bbc2, implements a collision detection by trying to import the same existing accounts nd, maintaining backward compatibility with manual naming preserves profile management behaviour & command structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request/description ODHack9 Label for tasks to be done in the ODHack October sncast
Projects
Status: Triage
Development

Successfully merging a pull request may close this issue.

10 participants