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: Enhance forc-deploy UX with dialoguer #6278

Merged
merged 14 commits into from
Jul 24, 2024
Merged

Conversation

sdankel
Copy link
Member

@sdankel sdankel commented Jul 17, 2024

Description

Improves the UX for forc-deploy in the following ways:

  • uses dialoguer for a nicer interface for entering password, selecting the wallet account from the list, and agreeing to sign.
  • displays the account information in a single line, with the ETH value shown rather than the raw gwei, similar to the browser wallet
  • only shows the base asset amount for accounts, rather than all assets, since only base asset can be used for gas fees.
  • for multiple-contract deployments, users now only have to choose the account and confirm once
  • added error handling for the case where multi-contract deployments have different networks specified in their manifests
  • Displays the network URL before deployment rather than after
  • After deployment, links to the contract and block in the block explorer rather than just showing the ID

Single contract deployed

Jul-17-2024 12-29-53

Multiple contracts deployed (workspace)

Jul-17-2024 12-33-11

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@JoshuaBatty
Copy link
Member

Awesome work, looks so much nicer to use. We might want to also update the quickstart showing the new workflow as well

https://docs.fuel.network/guides/contract-quickstart/#setting-up-a-local-wallet

@JoshuaBatty JoshuaBatty added the forc-deploy Everything to do with forc-deploy label Jul 18, 2024
Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice! Excited to see this land. After this one, I'll also have a refactor PR, which I am working on right now, which also clean some function signatures like this one does for couple of them. I'm planning to open it after this one is merged :)

@sdankel
Copy link
Member Author

sdankel commented Jul 22, 2024

Awesome work, looks so much nicer to use. We might want to also update the quickstart showing the new workflow as well

https://docs.fuel.network/guides/contract-quickstart/#setting-up-a-local-wallet

Opened a request: https://github.com/FuelLabs/devrel-requests/issues/16

@sdankel sdankel marked this pull request as ready for review July 22, 2024 18:02
@sdankel sdankel requested review from a team as code owners July 22, 2024 18:02
@JoshuaBatty JoshuaBatty requested a review from a team July 23, 2024 00:49
@IGI-111
Copy link
Contributor

IGI-111 commented Jul 23, 2024

Love the interactivity but is this still usable in a script without interaction?

If not I think that capability should be maintained, people will want to automate deploys.

@sdankel
Copy link
Member Author

sdankel commented Jul 23, 2024

Love the interactivity but is this still usable in a script without interaction?

If not I think that capability should be maintained, people will want to automate deploys.

@mchristopher asked the same thing :) See #6278 (comment)

To expand on this, users can use the --default-signer option or pass the signing key to bypass the interactivity like this:

forc wallet account <index> private-key
# enter password and copy key
forc deploy <signing key>

We should also support setting the secret key in an environment variable, I'll open a separate PR for that: #6293

@sdankel sdankel merged commit bdd14c3 into master Jul 24, 2024
38 checks passed
@sdankel sdankel deleted the sophie/deploy-dialoguer branch July 24, 2024 23:57
sdankel added a commit that referenced this pull request Jul 25, 2024
## Description

Merging in master, specifically the merge conflicts from
#6278

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
esdrubal pushed a commit that referenced this pull request Aug 13, 2024
## Description

Improves the UX for forc-deploy in the following ways:
- uses `dialoguer` for a nicer interface for entering password,
selecting the wallet account from the list, and agreeing to sign.
- displays the account information in a single line, with the ETH value
shown rather than the raw gwei, similar to the browser wallet
- only shows the base asset amount for accounts, rather than all assets,
since only base asset can be used for gas fees.
- for multiple-contract deployments, users now only have to choose the
account and confirm once
- added error handling for the case where multi-contract deployments
have different networks specified in their manifests
- Displays the network URL *before* deployment rather than after
- After deployment, links to the contract and block in the block
explorer rather than just showing the ID

### Single contract deployed

![Jul-17-2024
12-29-53](https://github.com/user-attachments/assets/f9ac8dbe-4473-4c71-95fa-7df758c550d8)

### Multiple contracts deployed (workspace)

![Jul-17-2024
12-33-11](https://github.com/user-attachments/assets/0270c05f-2495-4d90-a8e4-773cb1cd96b5)

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forc-deploy Everything to do with forc-deploy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants