-
Notifications
You must be signed in to change notification settings - Fork 75
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
[22.0] stellar keys generate
should no longer fund
#1407
Comments
This is because we flatten in the network and told clap we expected either rpc url and network passphrase or network. One solution is to remove from clap and instead the error will move from parsing to just when a the network needs to be resolved. So it should be an easy fix since we already handle the latter error. |
Another option is we remove funding from generating. I find it odd that every time I generate a key, I get an account on testnet, when sometimes I don't want an account created either now or not yet. |
Yeah perhaps we should flip the flag. This way users who want to have it work in one step can still use just one command. |
A downside of this is that when someone has a network set as an env var, it'd still be picked up there, so I could feel like I'm typing a simple generate command but then get hit with funding because I set the env var for commands that I expected to use the network. |
I think the idea was to flip the logic to always not fund as a breaking change in 22.0 |
Adding a But a flipped flag would be fine too, it's just two ways to do the same thing. |
Hmm yeah that makes sense, you can just |
Yeah we should strive to make each command do one thing as much as possible. I am still a little annoyed that deploy hash --wasm and does the install as well. Being explicit as much as possible helps people understand the steps. |
stellar keys generate
should no longer fund
I feel the case where keys are funded is more common than the other way around. I believe we should fix If not, I vote for adding |
I think adding a |
BTW due to how clap flattening works we can't fix it right now, at least not easily 😔 (you can't make group to be optional, which network options is) |
One solution is to not have clap handle what is required. Currently there is a stellar-cli/cmd/soroban-cli/src/config/network.rs Lines 41 to 67 in c8c3871
|
Or in the case where you just have the network args: stellar-cli/cmd/soroban-cli/src/config/network.rs Lines 71 to 88 in c8c3871
|
We can indeed make all network args optional, but then we need to do validation ourselves, which will give a different input compared to clap (don't think it's a major downside, but still) |
^ One of the reasons I want to see that change actually 😆 |
I'm saying we are already doing the validation. So removing the clap requires should not break anything, though we might need to improve the error message. |
This issue is stale because it has been assigned for 30 days with no activity. It will be closed in 30 days unless the stale label is removed, and the assignee is removed or updated. |
(Original reported issue by @chadoh below)
Currently,
stellar keys generate
not only generate keys, but also funds them. This is a bit confusing for the user (e.g. the original error Chad has encountered), and makes thing more complicated because same thing can be done in multiple ways.The proposal is to remove fund functionality from
keys generate
, as well as all network related flags (no network connection is needed anymore, we just generating key pair), and--no-fund
(this is a default behavior now).User can still fund keys with
stellar keys fund
Because this is a breaking change, we can't make it before 22.0
What version are you using?
What did you do?
What did you expect to see?
If no network provided, should generate keys and quietly skip funding.
If I provide
--no-fund
, same behavior.What did you see instead?
Errors unless network provided
The text was updated successfully, but these errors were encountered: