Skip to content

Commit

Permalink
refactor: use variables for testnet & faucet (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz authored Oct 26, 2023
1 parent 858a7f0 commit c196bc6
Show file tree
Hide file tree
Showing 17 changed files with 216 additions and 120 deletions.
51 changes: 28 additions & 23 deletions docs/guides/docs/installation/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ 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. This will install `forc`, `forc-client`, `forc-fmt`, `forc-lsp`, `forc-wallet` as well as `fuel-core` in `~/.fuelup/bin`.
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*/}

👉 Just paste the following line in your terminal and press *Enter*.
Expand All @@ -62,7 +63,8 @@ curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh
### Setup PATH

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

```sh
fuelup uses "/home/username/.fuelup" as its home directory to manage the Fuel toolchain, and will install binaries there.
Expand Down Expand Up @@ -107,7 +109,8 @@ 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 `beta-4` toolchain, which is the stable toolchain compatible with the beta-4 network. For more information on `beta-4` check the [Fuel blog](https://fuel-labs.ghost.io/announcing-beta-4-testnet/) page.
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 @@ -128,53 +131,55 @@ Unpacking and moving fuelup to /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/
Moving /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHt/fuelup to /Users/.fuelup/bin/fuelup
```

### Installing the beta-4 toolchain
### Installing the {props.fuelTestnet} toolchain

The `beta-4` network is the latest Fuel testnet. This includes public infrastructure such as the [Beta-4 faucet](https://faucet-beta-4.fuel.network/) and the [Beta-4 GraphQL endpoint](https://beta-4.fuel.network/playground).
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 `beta-4` network it is necessary to use its corresponding toolchain.
To properly interact with the {props.fuelTestnetInlineCode} network it is necessary to use its corresponding toolchain.

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

{/*install_beta-4_command:example:start*/}
{/*install_testnet_command:example:start*/}

```console
fuelup toolchain install beta-4
fuelup toolchain install {props.fuelTestnet}
```

{/*install_beta-4_command:example:end*/}
{/*install_testnet_command:example:end*/}

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

```sh
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 `beta-4` toolchain as the default.
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_beta-4:example:start*/}
👉 Set `beta-4` as your default toolchain with the following command:
{/*set_default_beta-4:example:end*/}
{/*set_default_testnet:example:start*/}
👉 Set {props.fuelTestnetInlineCode} as your default toolchain with the following command:
{/*set_default_testnet:example:end*/}

{/*set_default_beta-4_command:example:start*/}
{/*set_default_testnet_command:example:start*/}

```console
fuelup default beta-4
fuelup default {props.fuelTestnet}
```

{/*set_default_beta-4_command:example:end*/}
{/*set_default_testnet_command:example:end*/}

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

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

### Checking your current toolchain

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.
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 @@ -209,7 +214,7 @@ forc : 0.45
forc-wallet : 0.45
```

As you can see, the beta-4 toolchain is active 🚀
As you can see, the {props.fuelTestnetInlineCode} toolchain is active 🚀

## What's next?

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/docs/quickstart/building-a-frontend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Before going to the next steps, install the Fuel Wallet [here](https://chrome.go

If you have previously installed the wallet, make sure you have updated to the latest version.

Once you've installed the wallet, take the address of your wallet and use it to get some coins from [the testnet faucet](https://faucet-beta-4.fuel.network/).
Once you've installed the wallet, take the address of your wallet and use it to get some coins from the {props.faucetLink}.

## Initialize a React project

Expand Down
12 changes: 7 additions & 5 deletions docs/guides/docs/quickstart/building-a-smart-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,37 @@ parent:

<TextImport
file="../installation/index.mdx"
comment="install_beta-4"
comment="install_testnet"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="install_beta-4_command"
comment="install_testnet_command"
commentType="{/*"
lang="sh"
trim="true"
/>

<TextImport
file="../installation/index.mdx"
comment="set_default_beta-4"
comment="set_default_testnet"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="set_default_beta-4_command"
comment="set_default_testnet_command"
commentType="{/*"
lang="sh"
trim="true"
/>

{/*install_help:example:start*/}
For more detailed instructions on installing `fuelup`, visit the [installation guide](/guides/installation).

> Having problems with this part? Post your question on our [forum](https://forum.fuel.network/). To help you as efficiently as possible, include the output of this command in your post: `fuelup show.`
{/*install_help:example:end*/}

## Your First Sway Project

Expand Down Expand Up @@ -475,7 +477,7 @@ forc wallet accounts

### Get Testnet Coins

With your account address in hand, head to the [testnet faucet](https://faucet-beta-4.fuel.network/) to get some coins sent to your wallet.
With your account address in hand, head to the {props.faucetLink} to get some coins sent to your wallet.

### Deploy To Testnet

Expand Down
86 changes: 61 additions & 25 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 @@ -10,31 +10,67 @@ parent:

## Installation

{/*This example should include the instructions for installing Rust & Fuelup*/}
{/*installation:example:start*/}
Start by [installing the Rust toolchain](https://www.rust-lang.org/tools/install).

Then, [install the Fuel toolchain](/docs/fuelup/installation).
{/*installation:example:end*/}

{/*This example should include the instructions for installing the latest toolchain*/}
{/*toolchain_installation:example:start*/}
Make sure you have the latest version of `fuelup` by running the following command:

```console
fuelup self update
```

Then run `fuelup toolchain install beta-4` to install the `beta-4` toolchain.

Finally, set the `beta-4` toolchain as your default distribution with the following command:

```sh
$ fuelup default beta-4
default toolchain set to 'beta-4-aarch64-apple-darwin'
```

You can check your current toolchain anytime by running `fuelup show` to ensure you have `fuel-core 0.20.4`.
<TextImport
file="../installation/index.mdx"
comment="install_rust"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="install_rust_command"
commentType="{/*"
lang="sh"
trim="true"
/>

<TextImport
file="../installation/index.mdx"
comment="install_fuelup"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="install_fuelup_command"
commentType="{/*"
lang="sh"
trim="true"
/>

<TextImport
file="../installation/index.mdx"
comment="install_testnet"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="install_testnet_command"
commentType="{/*"
lang="sh"
trim="true"
/>

<TextImport
file="../installation/index.mdx"
comment="set_default_testnet"
commentType="{/*"
/>

<CodeImport
file="../installation/index.mdx"
comment="set_default_testnet_command"
commentType="{/*"
lang="sh"
trim="true"
/>

<TextImport
file="../quickstart/building-a-smart-contract.mdx"
comment="install_help"
commentType="{/*"
/>

## Getting a Sepolia (Ethereum Testnet) API Key

Expand Down
6 changes: 4 additions & 2 deletions 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 Expand Up @@ -113,7 +114,8 @@
"@adobe/css-tools@<4.3.1": ">=4.3.1",
"graphql@>=16.3.0 <16.8.1": ">=16.8.1",
"postcss@<8.4.31": ">=8.4.31",
"zod@<=3.22.2": ">=3.22.3"
"zod@<=3.22.2": ">=3.22.3",
"next@<13.4.20-canary.13": ">=13.4.20-canary.13"
}
}
}
Loading

0 comments on commit c196bc6

Please sign in to comment.