Skip to content

Commit

Permalink
Update Sway book section on forc-wallet for changes in v0.2.0 (Fuel…
Browse files Browse the repository at this point in the history
…Labs#4146)

## Description

See the detailed release notes for `forc-wallet` v0.2.0 here:

https://github.com/FuelLabs/forc-wallet/releases/tag/v0.2.0

Related: FuelLabs/forc-wallet#87.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] 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).
- [x] I have requested a review from the relevant team or maintainers.
  • Loading branch information
mitchmindtree authored Feb 21, 2023
1 parent 4ffa867 commit af634d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/book/src/forc/plugins/forc_client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Forc plugin for interacting with a Fuel node.

If you don't have an initialized wallet or any account for your wallet you won't be able to sign transactions.

To initialize a wallet you can use `forc wallet init`. It will ask you to choose a password to encrypt your wallet. After the initialization is done you will have your mnemonic phrase.
To create a wallet you can use `forc wallet new`. It will ask you to choose a password to encrypt your wallet. After the initialization is done you will have your mnemonic phrase.

After you have an initialized wallet, you can create an account for it by simply running `forc wallet new`. It will ask your password to decrypt the wallet before creating an account.
After you have created a wallet, you can derive a new account by running `forc wallet account new`. It will ask your password to decrypt the wallet before deriving an account.

## Signing transactions using `forc-wallet` CLI

Expand All @@ -21,15 +21,15 @@ If you want to run `fuel-core` with UTXO validation, you can pass `--utxo-valida
To install `forc-wallet` please refer to `forc-wallet`'s [github repo](https://github.com/FuelLabs/forc-wallet#forc-wallet).

1. Construct the transaction by using either `forc deploy` or `forc run`. To do so simply run `forc deploy` or `forc run` with your desired parameters. For a list of parameters please refer to the [forc-deploy](./forc_deploy) or [forc-run](./forc_run) section of the book. Once you run either command you will be asked the address of the wallet you are going to be signing with. After the address is given the transaction will be generated and you will be given a transaction ID. At this point CLI will actively wait for you to insert the signature.
2. Take the transaction ID generated in the first step and sign it with `forc wallet sign <transaction_id> <account_index>`. This will generate a signature.
2. Take the transaction ID generated in the first step and sign it with `forc wallet sign --account <account_index> tx-id <transaction_id>`. This will generate a signature.
3. Take the signature generated in the second step and provide it to `forc-deploy` (or `forc-run`). Once the signature is provided, the signed transaction will be submitted.

## Other useful commands of `forc-wallet`

- You can see a list of existing accounts with `list` command.
- You can see a list of existing accounts with `accounts` command.

```sh
forc wallet list
forc wallet accounts
```

- If you want to retrieve the address for an account by its index you can use `account` command.
Expand Down

0 comments on commit af634d6

Please sign in to comment.