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

docs: Update contributing guide #3202

Closed
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
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
richardgreg marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ pnpm install
pnpm build
```

# 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.

# Developing

For building everything in watch-mode, run:
Expand Down Expand Up @@ -109,6 +121,70 @@ 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.

## 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`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petertonysmith94 I added the note about the files created here. Would you prefer it to be a separate section?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding it as a [!NOTE] would be enough. Maybe worth just adding something on what these directories contain :)


## 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
```

The following directory will be updated or created: `internal/fuel-core/fuel-core-repo`

# Switching Back to Standard Binaries
Copy link
Contributor Author

@richardgreg richardgreg Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the whole section on fixing the problem of the program using a previously downloaded binary


If you switch back to using standard binaries you might encounter issues where the SDK still uses the previously downloaded unreleased binaries.

## Resolving the Issue

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:
Expand Down
Loading