From ea4edbbe6675d496d88812bb9a159565be6ffd7c Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 4 Mar 2022 13:06:50 +1100 Subject: [PATCH] Update `forc` README for recent `out/` and lock file changes Related PRs #825, #796. --- forc/README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/forc/README.md b/forc/README.md index 72a8219f8a2..dbf045504d2 100644 --- a/forc/README.md +++ b/forc/README.md @@ -27,7 +27,7 @@ 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 @@ -35,6 +35,16 @@ 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 `.bin`. Building contracts and libraries will also produce the public ABI in JSON format `-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`). @@ -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.