-
Notifications
You must be signed in to change notification settings - Fork 81
Interactive account creation for mainnet, testnet and emulator #538
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
Conversation
Account creation improvements
# Conflicts: # go.mod # go.sum # pkg/flowkit/config/json/config.go
|
@srinjoyc if accounts are created using flow port they don't have enough funds to even send transactions. Shouldn't they be funded? |
| // | ||
| // Ref: https://docs.onflow.org/flow-cli/security/#private-account-configuration-file | ||
| Location string | ||
| UseAdvanceFormat bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| UseAdvanceFormat bool | |
| UseAdvancedFormat bool |
"Advance format" isn't quite valid grammar
| func outputList(log *output.StdoutLogger, items []string, numbered bool) { | ||
| log.Info(fmt.Sprintf("%s:", items[0])) | ||
| items = items[1:] | ||
| for n, item := range items { | ||
| sep := " -" | ||
| if numbered { | ||
| sep = fmt.Sprintf(" %d.", n+1) | ||
| } | ||
| log.Info(fmt.Sprintf("%s %s", sep, item)) | ||
| } | ||
| log.Info("") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go in the output package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could yeah. Wilco. Generally, I was thinking about refactoring this interactive UI into a separate file since more commands will introduce this mode and it could be nicer to have an interactive UI component handling that. Not sure yet exactly how, since I want to wait a bit to see the pattern evolving but I have in mind to refactor this down the line, I don't like the command itself becoming bloated with these interactive responses.
Co-authored-by: Peter Siemens <peterjsiemens@gmail.com>
Co-authored-by: Peter Siemens <peterjsiemens@gmail.com>
Co-authored-by: Peter Siemens <peterjsiemens@gmail.com>
Co-authored-by: Peter Siemens <peterjsiemens@gmail.com>
Co-authored-by: Peter Siemens <peterjsiemens@gmail.com>
psiemens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall.
That public key check bug is strange. It sounds like a data consistency issue coming from the AN… did you get a chance to investigate?
Yep investigated and fixed. It was in fact a bug in CLI as seen here: 71f9fd6 |
Closes #537
Description
This PR implements the account creation interactive flow for mainnet, testnet and emulator networks. It also covers the encryption of keys for mainnet case. It also provides password prompts when running other commands with the encrypted keys.
The flow is as follows, you choose the network, if the chosen network is testnet then the faucet website is opened, if it's mainnet the flow port is opened, after you complete the required steps in browser to create an account, the CLI listens for new account creation event and stores the account in configuration. In the case of mainnet it offers you an option to encrypt.
Some screens:




DOD:
For contributor use:
masterbranchFiles changedin the Github PR explorer