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

forc-deploy UX feedback #4723

Closed
SilentCicero opened this issue Jun 30, 2023 · 2 comments
Closed

forc-deploy UX feedback #4723

SilentCicero opened this issue Jun 30, 2023 · 2 comments
Assignees
Labels
code quality enhancement New feature or request forc forc-deploy Everything to do with forc-deploy

Comments

@SilentCicero
Copy link
Member

SilentCicero commented Jun 30, 2023

Here is my feedback regarding the forc-deploy experience.

High Level

  • Wallet Communication: forc-deploy should have better communication with existing wallets, the current experience is horrible and complicated to use (where developers have to copy and paste things like salts, addresses and keys), this should never be the case with production CLI tooling. If no wallet is available, forc-deploy should offer to run forc wallet new, then forc sign, as well as as should check the balance of the deploying account and if no funds recommend the faucet.
  • Artifacts: forc-deploy should produce deployment artifacts, once I deploy a contract, it should give me a JSON or YAML or all the data from that deployment, things like transaction id, salt, network endpoint, chain id, contract id, deployment_size. The deployment information should be instance based, meaning, if I deploy a contract twice with all the same data (but maybe the salt or timestamp is different), it should have a higher order instance ID or log or store the historical deployments in a log of somekind. You don't want to lose the deployment data, especially if its an expensive deployment.
  • Simplified Defaults: forc-deploy should come with some nice defaults like:
    • --testnet which would always do “—target=beta-3” with the latest stable testnetwork
    • --random-salt should always be on by default unless a salt is specified
    • Should always produce an artifacts file in /out/ unless specified otherwise
  • Be more helpful: Overall the tool should be more helpful and accommodating for early developers, be explicit, we have to assume they don't know where things are and what is available. Forc deploy can offer a better experience.
  • Bech32: Data like contract ID's is not returned in proper hex formatting and does not provide Bech32 formatted addresses.

Current Experience (Deployment to Testnet)

[Two terminal windows required]

  1. Setup project
  2. Build your contracts
  3. Run forc-deploy, have to look for and specify latest network and random salt
  4. A request is sent for an address
  5. A user has to switch windows to find / create their wallet and address
  6. The address gets entered
    “Please provide the address of the wallet you are going to sign this transaction with:fuel1xgan7jk7srzptu2f96eshu9geh60dsaqpl5aafxn337myy0prp7q6l8z0s Transaction id to sign: b92b502060f072384e9ec0bab249adbd310daa857b0cc90f026425b3db9695e2 Please provide the signature:”
  7. A salt is provided
  8. A user has to copy and paste the salt into a pre-specified forc wallet account sign command in a separate window
  9. The returned signature must be copied from the second window back to the first window
  10. Then the deployment occurs, a contract ID is presented in non-hex prefixed, non bech32 address
  11. The entire transaction may need to be repeated as no balance check was done, user may not have funds to start and will have to find and go to the faucet and repeat the sequence above.

Desired Experience

[One terminal window required]

  1. Setup project
  2. Build your contracts
  3. Run forc deploy --testnet
Select wallet:
[ x ] forc wallet (default)
[   ] manual entry
  1. Runs forc wallet account 0.. password entry, if they don't have an account recommend forc wallet new walk them through wallet creation, then walk then through fauceting funds
  2. Checks balance of wallet on selected network, if not enough funds, state this provide options to resolve the issue [skip step if they have enough balance], prepare a faucet link for them.
    Not enough Ether for deployment, please faucet some funds by going to this link and following the steps: https://faucet-beta-3.fuel.network/?address=[their address] [Check balance and continue]
  3. Then run the forc wallet 0 sign [the tx id for deployment] command for them [user enters password]
  4. Contract deploying message stated
  5. Contract deployed! Artifacts have been produced to this json file, /out/deployments.json.
Contract Counter Deployed!

Deployment artifacts can be found in `/out/deployments.json`

Network: beta-3.network...
URL: [link to beta-3 URL block explorer]
Contract ID: [insert contract ID in bech32 and hex]

Intuitions

  • The flow should be smooth, if they don't have a wallet, help them create one
  • Offer the manual flow as well, but make forc wallet the default
  • Check their balance, offer them a way to get Ether easily (they might not know where the faucet is, tell them and pre-fill the address)
  • Record the artifacts and let them know where they are so they can use them in their project.

Extra:

Further, the SDK should be able to pickup this standard deployments file and provide nice macros and tooling for use in other tools.

@SilentCicero SilentCicero added enhancement New feature or request forc code quality forc-deploy Everything to do with forc-deploy labels Jun 30, 2023
@kayagokalp
Copy link
Member

Sounds great! Thanks for the detailed explanation, couple of the concerns listed here are open issues already but most of them are new so I'll try to collect them under this issue to better organize UX improvement effort.

@kayagokalp
Copy link
Member

Closing this in favor of #4745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality enhancement New feature or request forc forc-deploy Everything to do with forc-deploy
Projects
None yet
Development

No branches or pull requests

2 participants