diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d7a7547429..bb260ad18e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,6 +109,85 @@ See also: - [Developing](#developing) +# Working with Unreleased Forc and Fuel-Core Functionality + +When you need to work with unreleased versions of `forc` or `fuel-core`, you can specify a git branch instead of a version number in the respective `VERSION` file. + +## Using Unreleased Forc + +To use an unreleased version of `forc`: + +1. **Edit the `VERSION` File** + Open the `internal/forc/VERSION` file and replace the version number (e.g., `0.59.0`) with the desired git branch: + + ```text + git:some/branch-name + ``` + +1. **Install and Build** + To download and build `forc` from the specified branch after updating `VERSION` file, run: + + ```sh + pnpm install + pnpm build + ``` + +The following directory will be updated or created: `internal/forc/sway-repo` + +## Using Unreleased Fuel-Core + +Similarly, to use an unreleased version of `fuel-core`: + +1. **Edit the `VERSION` file:** + Open the `internal/fuel-core/VERSION` file and replace the version number with the desired git branch: + + ```text + git:some/branch-name + ``` + +1. **Install and Build** + To download and build `fuel-core` from the specified branch after updating `VERSION` file, run: + + ```sh + pnpm install + pnpm build + ``` + +> [!Note] +> The `internal/forc/sway-repo` and `internal/fuel-core/fuel-core-repo` directory will contain a local clone of the Sway and Fuel Core repository respectively, at the specific version or git branch you have specified in the `internal/forc/VERSION` and `internal/fuel-core/VERSION` file. + +## Unreleased Files and Directories Created After Installation + +After running `pnpm install` and `pnpm build`, the following files and directories are created: + +- Forc Repository: + + - Located at `internal/forc/sway-repo`. + - Contains the source code for the version of `forc` you are using. + +- Fuel-Core Repository: + - Located at `internal/fuel-core/fuel-core-repo`. + - Contains the source code for the version of `fuel-core` you are using. + +## Switching Back to Standard Binaries + +If you switch back to using standard binaries you might encounter issues where the SDK still uses the previously downloaded unreleased binaries. + +To resolve the issue and ensure the SDK uses the correct binaries: + +1. **Delete the downloaded repositories** + + ```sh + rm -rf internal/forc/sway-repo + rm -rf internal/fuel-core/fuel-core-repo + ``` + +1. **Reinstall and build** + ```sh + pnpm install + pnpm build + ``` + # Testing In order to run tests locally, you can run the following commands: @@ -182,6 +261,12 @@ DEVNET_WALLET_PVT_KEY=0x... TESTNET_WALLET_PVT_KEY=0x... ``` +This will enable you to run the e2e test locally against the live network: + +```sh +pnpm test:filter e2e-script +``` + # Commit Convention