o1-labs / zkapp-cli

CLI to create a zkApp (zero-knowledge app) for Mina Protocol
https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp
Apache License 2.0
115 stars 44 forks source link

Allow user to select an existing key for a new deploy alias #414

Open Isaac-DeFrain opened 1 year ago

Isaac-DeFrain commented 1 year ago

Describe the problem

I added the ability to set the key in an existing deploy alias (among other things), but it would be nice to have the ability to select an existing key when creating a deploy alias instead. I am not familiar enough with yargs to add this feature (I tried but was unsuccessful).

Describe the proposed solution

Instead of always generating a new keypair for a deploy alias, include an option to choose from existing keys.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

ymekuria commented 1 year ago

Thanks for the suggestion @Isaac-DeFrain. We will look into this. Can you clarify what you are suggesting?

Isaac-DeFrain commented 1 year ago

Sure! When creating a deploy alias via zk config, currently a new keypair is always created for the alias. It would be nice to have an option to select one of the existing keypairs in ./keys to use for a new alias. In my mind the flow is something like this:

User runs zk config

  1. User is prompted to enter a deploy alias name.
  2. User is prompted to enter a graphql API URL.
  3. User is prompted to set the transaction fee.

// requested addition option 1

  1. User is prompted to generate a new keypair or select an existing keypair from ./keys. It probably makes the most sense to display the generate new option at the top and existing keys below that.

// option 2

  1. User is prompted to enter a name for the key. If the name already exists in ./keys, that key will be used. Default name (i.e. just press enter) is the same as the alias and generates a new keypair.