Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz committed Oct 24, 2023
1 parent 8131ca2 commit b1c0a92
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 47 deletions.
66 changes: 39 additions & 27 deletions docs/guides/docs/installation/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ parent:

# Toolchain installation

This guide will help you to install the Fuel toolchain binaries and prerequisites.
This guide will help you to install the Fuel toolchain binaries and prerequisites.

This guide covers the following topics:

1. [Installing Rust](#installing-rust)
2. [Installing the Fuel toolchain using `fuelup`](#installing-the-fuel-toolchain-using-fuelup)
3. [Setting up a default toolchain](#setting-up-a-default-toolchain)
Expand All @@ -23,11 +24,13 @@ The Fuel toolchain is built on top of the Rust programming language. To install

Run the following command in your shell; this downloads and runs rustup-init.sh, which in turn downloads and runs the correct version of the `rustup-init` executable for your platform.

{/* install_rust_command:example:start */}
{/*install_rust_command:example:start*/}

```console
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
{/* install_rust_command:example:end */}

{/*install_rust_command:example:end*/}

Check the official Rust documentation to get more information on [installing the Rust toolchain](https://www.rust-lang.org/tools/install).

Expand All @@ -41,24 +44,26 @@ toolchains and keep them updated. It makes building and maintaining Sway applica
### Running fuelup-init

{/* install_fuelup:example:start */}
To install the Fuel toolchain, you'll use the `fuelup-init` script.
{/*install_fuelup:example:start*/}
To install the Fuel toolchain, you'll use the `fuelup-init` script.
This will install `forc`, `forc-client`, `forc-fmt`, `forc-lsp`, `forc-wallet` as well as `fuel-core` in `~/.fuelup/bin`.
{/* install_fuelup:example:end */}
{/*install_fuelup:example:end*/}

👉 Just paste the following line in your terminal and press _Enter_.
👉 Just paste the following line in your terminal and press *Enter*.

{/*install_fuelup_command:example:start*/}

{/* install_fuelup_command:example:start */}
```sh
curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh
```
{/* install_fuelup_command:example:end */}

{/*install_fuelup_command:example:end*/}

> 🚧 Be aware that currently we do not natively support Windows. If you wish to use `fuelup` on Windows, please use Windows Subsystem for Linux.
### Setup PATH

Once the script is downloaded, it will be executed automatically.
Once the script is downloaded, it will be executed automatically.
The `fuelup-init` script will prompt you with the question below:

```sh
Expand All @@ -73,11 +78,11 @@ If permitted, fuelup-init will configure your PATH for you by running the follow
Would you like fuelup-init to modify your PATH variable for you? (N/y)
```

👉 Press the `Y` key in your terminal and press _Enter_ to modify your PATH.
👉 Press the `Y` key in your terminal and press *Enter* to modify your PATH.

### Checking the installation

After allowing the `fuelup-init` script to modify your `PATH` variable, you will see a lot of information about packages being downloaded and installed. If everything goes as expected you will see the following message:
After allowing the `fuelup-init` script to modify your `PATH` variable, you will see a lot of information about packages being downloaded and installed. If everything goes as expected you will see the following message:

```sh
The Fuel toolchain is installed and up to date
Expand All @@ -92,6 +97,7 @@ To generate completions for your shell, run 'fuelup completions --shell=SHELL'.
```sh
fuelup --version
```

That will output your current `fuelup` version:

```sh
Expand All @@ -103,7 +109,7 @@ fuelup 0.19.5
Just as in [Rust](https://rust-lang.github.io/rustup/concepts/toolchains.html), Fuel supports multiple toolchains. A toolchain is a collection of tools (such as the compiler, lsp, etc).
By default, `fuelup` includes a series of packages tested to work with each other, providing a reliable set of tools.

In this case, we will install the {props.fuelTestnetInlineCode} toolchain, which is the stable toolchain compatible with the {props.fuelTestnetInlineCode} network.
In this case, we will install the {props.fuelTestnetInlineCode} toolchain, which is the stable toolchain compatible with the {props.fuelTestnetInlineCode} network.
For more information on {props.fuelTestnetInlineCode} check the [Fuel blog](https://fuel-labs.ghost.io/announcing-beta-4-testnet/) page.

### Updating fuelup
Expand All @@ -115,7 +121,9 @@ Make sure you have the latest version of `fuelup` so you can access the latest f
```console
fuelup self update
```

Then you will get an output like this:

```console
Fetching binary from https://github.com/FuelLabs/fuelup/releases/download/v0.19.5/fuelup-0.19.5-aarch64-apple-darwin.tar.gz
Downloading component fuelup without verifying checksum
Expand All @@ -125,20 +133,22 @@ Moving /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHt/fuelup to /Us

### Installing the {props.fuelTestnet} toolchain

The {props.fuelTestnetInlineCode} network is the latest Fuel testnet.
The {props.fuelTestnetInlineCode} network is the latest Fuel testnet.
This includes public infrastructure such as the {props.faucetLink} and the {props.GQLPlaygroundLink}.

To properly interact with the {props.fuelTestnetInlineCode} network it is necessary to use its corresponding toolchain.

{/* install_testnet:example:start */}
{/*install_testnet:example:start*/}
👉 Run the following command to install the {props.fuelTestnetInlineCode} toolchain:
{/* install_testnet:example:end */}
{/*install_testnet:example:end*/}

{/*install_testnet_command:example:start*/}

{/* install_testnet_command:example:start */}
```console
fuelup toolchain install {props.fuelTestnet}
```
{/* install_testnet_command:example:end */}

{/*install_testnet_command:example:end*/}

If the toolchain was successfully installed, you will see this output:

Expand All @@ -148,25 +158,27 @@ The Fuel toolchain is installed and up to date

The toolchain was installed correctly, however is not in use yet. Next, you need to configure `fuelup` to use the {props.fuelTestnetInlineCode} toolchain as the default.

{/* set_default_testnet:example:start */}
{/*set_default_testnet:example:start*/}
👉 Set {props.fuelTestnetInlineCode} as your default toolchain with the following command:
{/* set_default_testnet:example:end */}
{/*set_default_testnet:example:end*/}

{/*set_default_testnet_command:example:start*/}

{/* set_default_testnet_command:example:start */}
```console
fuelup default {props.fuelTestnet}
```
{/* set_default_testnet_command:example:end */}

You will get the following output indicating that you have successfully set {props.fuelTestnetInlineCode} as your default toolchain.
{/*set_default_testnet_command:example:end*/}

You will get the following output indicating that you have successfully set {props.fuelTestnetInlineCode} as your default toolchain.

```console
default toolchain set to '{props.fuelTestnet}'
```

### Checking your current toolchain

Sometimes you might end up using multiple toolchains at once.
Sometimes you might end up using multiple toolchains at once.
Don't worry if you get confused about which toolchain you are using, since you can check your current toolchain anytime.

👉 Run the `fuelup show` command to see the toolchain and the versions of each tool you are using.
Expand Down Expand Up @@ -214,7 +226,7 @@ Now you are ready to start building with Fuel.

### Custom toolchains

You can create your own set of specific versions, this is known as 'custom toolchains'.
You can create your own set of specific versions, this is known as 'custom toolchains'.

> 👉 Visit the [Fuelup docs](docs/fuelup/concepts/toolchains) to learn how to set up your own custom toolchains.
Expand All @@ -226,6 +238,6 @@ You can always build the Fuel packages from source.
### Github Codespaces

It's always possible to run a development environment in the browser.
It's always possible to run a development environment in the browser.

> 👉 Please visit our guide on [Github Codespaces](guides/installation/codespace) to use the Fuel toolchain in the browser.
> 👉 Please visit our guide on [Github Codespaces](guides/installation/codespace) to use the Fuel toolchain in the browser.
30 changes: 15 additions & 15 deletions docs/guides/docs/quickstart/building-a-smart-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ We'll build a simple counter contract with two functions: one to increment the c

<TestAction
id="create-project-folder"
action={{
name: 'runCommand',
action={{
name: 'runCommand',
commandFolder: 'guides-testing'
}}
/>
Expand All @@ -103,7 +103,7 @@ Then create a contract project using `forc`:
<TestAction
id="create-contract"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project'
}}
/>
Expand Down Expand Up @@ -131,14 +131,14 @@ Report Bugs:
- Sway Issues: https://github.com/FuelLabs/sway/issues/new
```

{/* This example should include a tree for a new `forc` project and explain the boilerplate files */}
{/* forc_new:example:start */}
{/*This example should include a tree for a new `forc` project and explain the boilerplate files*/}
{/*forc_new:example:start*/}
Here is the project that `forc` has initialized:

<TestAction
id="contract-tree"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project'
}}
/>
Expand All @@ -153,8 +153,8 @@ counter-contract
1 directory, 2 files
```

`forc.toml` is the _manifest file_ (similar to `Cargo.toml` for Cargo or `package.json` for Node) and defines project metadata such as the project name and dependencies.
{/* forc_new:example:end */}
`forc.toml` is the *manifest file* (similar to `Cargo.toml` for Cargo or `package.json` for Node) and defines project metadata such as the project name and dependencies.
{/*forc_new:example:end*/}

Open your project in a code editor and delete everything in `src/main.sw` apart from the first line.

Expand Down Expand Up @@ -219,7 +219,7 @@ Below your ABI definition, you will write the implementation of the functions de

<TestAction
id="impl"
action={{
action={{
name: 'modifyFile',
filepath: 'guides-testing/fuel-project/counter-contract/src/main.sw'
}}
Expand Down Expand Up @@ -270,7 +270,7 @@ Then run the following command to build your contract:
<TestAction
id="build-contract"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project/counter-contract'
}}
/>
Expand All @@ -291,7 +291,7 @@ Let's have a look at the content of the `counter-contract` folder after building
<TestAction
id="built-contract-tree"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project/counter-contract'
}}
/>
Expand Down Expand Up @@ -336,7 +336,7 @@ Now, let's generate the default test harness with the following:
<TestAction
id="cargo-generate-test"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project/counter-contract'
}}
/>
Expand All @@ -359,7 +359,7 @@ Let's have a look at the result:
<TestAction
id="cargo-test-tree"
action={{
name: 'runCommand',
name: 'runCommand',
commandFolder: 'guides-testing/fuel-project/counter-contract'
}}
/>
Expand Down Expand Up @@ -397,7 +397,7 @@ id="test-harness"
action={{
name: 'modifyFile',
filepath: 'guides-testing/fuel-project/counter-contract/tests/harness.rs',
addSpacesBefore: 1,
addSpacesBefore: 1,
}}
/>

Expand Down Expand Up @@ -505,7 +505,7 @@ Just below the list, you'll see this prompt:

Then you'll enter the number of the account of preference and press `Y` when prompted to accept the transaction.

Finally, you will get back the network endpoint where the contract was deployed, a `Contract ID` and the block where the transaction was signed.
Finally, you will get back the network endpoint where the contract was deployed, a `Contract ID` and the block where the transaction was signed.
Save the `Contract ID`, as you'll need this later to connect the frontend.
With this ID, you can also head to the [block explorer](https://fuellabs.github.io/block-explorer-v2/) to confirm the contract was deployed.

Expand Down
14 changes: 10 additions & 4 deletions docs/guides/docs/running-a-node/running-a-beta-4-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,28 @@ parent:
/>

## Getting a Sepolia (Ethereum Testnet) API Key
An API key from any RPC provider that supports the Sepolia network will work. Relayers will help listen to events from the Ethereum network. We recommend either [Infura](https://www.infura.io/) or [Alchemy](https://www.alchemy.com/)

An API key from any RPC provider that supports the Sepolia network will work. Relayers will help listen to events from the Ethereum network. We recommend either [Infura](https://www.infura.io/) or [Alchemy](https://www.alchemy.com/)

The endpoints should look like the following

### Infura

```sh
https://sepolia.infura.io/v3/{YOUR_API_KEY}
```

### Alchemy

```sh
https://eth-sepolia.g.alchemy.com/v2/{YOUR_API_KEY}
```

Note that using other network endpoints will result in the relayer failing to start.

## Generating a P2P Key
Generate a new P2P key pairing by running the following command:

Generate a new P2P key pairing by running the following command:

```sh
$ fuel-core-keygen new --key-type peering
Expand All @@ -98,7 +105,7 @@ $ fuel-core-keygen new --key-type peering
}
```

Make sure you save this somewhere safe so you don't need to generate a new key pair in the future.
Make sure you save this somewhere safe so you don't need to generate a new key pair in the future.

## Chain Configuration

Expand Down Expand Up @@ -351,4 +358,3 @@ To connect to the local node using a browser wallet, import the network address
```sh
http://127.0.0.1:4000/graphql
```

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"test:guides": "npx playwright test tests/test.spec.ts",
"test:guides:debug": "DEBUG=pw:api npx playwright test tests/test.spec.ts",
"ts:check": "tsc --noEmit",
"update-latest-docs": "sh ./scripts/update-latest-submodules.sh"
"lint:guides:check": "markdownlint --config .markdownlint.yaml --ignore-path .markdownlintignore '**/*.mdx'",
"lint:guides:fix": "markdownlint --config .markdownlint.yaml --ignore-path .markdownlintignore '**/*.mdx' --fix"
},
"dependencies": {
"@actions/exec": "^1.1.1",
Expand Down

0 comments on commit b1c0a92

Please sign in to comment.