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

Update forc README for recent out/ directory and lock file changes #873

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions forc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,24 @@ A `tests/` directory is also created. The `Cargo.toml` in the root directory con

## Build (`forc build`)

Compiles Sway files.
Compile the sway files of the current project.

```console
$ forc build
Compiled script "my-fuel-project".
Bytecode size is 28 bytes.
```

The output produced will depend on the project's program type. Building script, predicate and contract projects will produce their bytecode in binary format `<project-name>.bin`. Building contracts and libraries will also produce the public ABI in JSON format `<project-name>-abi.json`.

By default, these artifacts are placed in the `out/` directory.

If a `Forc.lock` file did not yet exist, it will be created in order to pin each of the dependencies listed in `Forc.toml` to a specific commit or version.

## Update (`forc update`)

Updates each of the dependencies so that they point to the latest suitable commit or version given their dependency declaration. The result is written to the `Forc.lock` file.

## Test (`forc test`)

You can write tests in Rust using our [Rust SDK](https://github.com/FuelLabs/fuels-rs). These tests can be run using `forc test`, which will look for Rust tests under the `tests/` directory (which is created automatically with `forc init`).
Expand Down Expand Up @@ -147,10 +157,6 @@ let compiled = Contract::compile_sway_contract("./", salt).unwrap();
let (client, contract_id) = Contract::launch_and_deploy(&compiled).await.unwrap();
```

## Update (`forc update`)

Update dependencies in the Forc dependencies directory.

## Format (`forc fmt`)

Format all Sway files of the current project.
Expand Down