From 7aa8758f5bf53f6c1ed059bfc72e021136558040 Mon Sep 17 00:00:00 2001 From: Sandusky <39354014+cold-briu@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:46:27 -0500 Subject: [PATCH 1/5] docs: link to docs hub fuel installation guide --- docs/book/src/introduction/installation.md | 169 +-------------------- 1 file changed, 2 insertions(+), 167 deletions(-) diff --git a/docs/book/src/introduction/installation.md b/docs/book/src/introduction/installation.md index 2ecafbaf3a9..609a76de162 100644 --- a/docs/book/src/introduction/installation.md +++ b/docs/book/src/introduction/installation.md @@ -1,170 +1,5 @@ # Installation -The _Sway toolchain_ is sufficient to compile Sway smart contracts. Otherwise, note that if you want to run Sway smart contracts (e.g. for testing), a Fuel Core full node is required, which is packaged together with the _Sway toolchain_ together as the _Fuel toolchain_. +## The `Fuel` toolchain -## Install via Pre-compiled Binaries (Recommended) - -Installing via pre-compiled release binaries is the recommended way to get up and running with the Sway toolchain. Pre-compiled binaries for Linux and macOS are available. Native Windows is currently unsupported ([tracking issue for Windows support](https://github.com/FuelLabs/sway/issues/1526)). Windows Subsystem for Linux should work but is not officially supported. - -### Dependencies - -A prerequisite for installing and using Sway is the Rust toolchain. Platform-specific instructions for installing `rustup` can be found [here](https://www.rust-lang.org/tools/install). Then, install the Rust toolchain with: - -```sh -# Install the latest stable Rust toolchain. -rustup install stable -``` - -The Sway toolchain is built and tested against the `stable` Rust toolchain version (). There is no guarantee it will work with the `nightly` Rust toolchain, or with earlier `stable` versions, so ensure you are using `stable` with: - -```sh -# Update installed Rust toolchain; can be used independently. -rustup update -# Set the stable Rust toolchain as default; can be used independently. -rustup default stable -``` - -Now you're ready to install [`fuelup`](https://github.com/FuelLabs/fuelup), the equivalent of Rust's `rustup` for the Fuel toolchain. It enables easily downloading binary releases of the Fuel toolchain. - -1. Start by installing `fuelup` with the following command: - - ```sh - curl --proto '=https' --tlsv1.2 -sSf \ - https://install.fuel.network/fuelup-init.sh | sh - ``` - - This downloads the `fuelup-init` script to a temp directory on your machine, which installs `fuelup`. `fuelup-init` will ask for permission to add `~/.fuelup/bin` to your PATH. Otherwise, you can also pass `--no-modify-path` so that `fuelup-init` does not modify your PATH: - - ```sh - curl --proto '=https' --tlsv1.2 -sSf \ - https://install.fuel.network/fuelup-init.sh | sh -s -- --no-modify-path - ``` - -2. Once fuelup is installed, fuelup-init automatically runs `fuelup toolchain install latest` to install the latest toolchain - - You can run `fuelup update` at anytime to get the most up-to-date toolchain. - -3. (Optional) You can optionally install distributed toolchains optimized for different networks. - - To configure the optimal toolchain for beta-3, run the following commands: - - ```sh - $ fuelup self update - Fetching binary from https://github.com/FuelLabs/fuelup/releases/download/v0.18.0/fuelup-0.18.0-aarch64-apple-darwin.tar.gz - Downloading component fuelup without verifying checksum - Unpacking and moving fuelup to /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpP3HfvR - Moving /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpP3HfvR/fuelup to /Users/user/.fuelup/bin/fuelup - - - $ fuelup toolchain install beta-3 - Downloading: forc forc-explore forc-wallet fuel-core fuel-indexer - - Adding component forc v0.35.0 to 'beta-3-aarch64-apple-darwin' - Fetching binary from https://github.com/FuelLabs/sway/releases/download/v0.35.0/forc-binaries-darwin_arm64.tar.gz - npacking and moving forc-doc to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Unpacking and moving forc to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Unpacking and moving forc-deploy to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Unpacking and moving forc-run to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Unpacking and moving forc-lsp to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Unpacking and moving forc-fmt to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Fetching core forc dependencies - Installed forc v0.35.0 for toolchain 'beta-3-aarch64-apple-darwin' - - Adding component forc-explore v0.28.1 to 'beta-3-aarch64-apple-darwin' - Fetching binary from https://github.com/FuelLabs/forc-explorer/releases/download/v0.28.1/forc-explore-0.28.1-aarch64-apple-darwin.tar.gz - Unpacking and moving forc-explore to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Installed forc-explore v0.28.1 for toolchain 'beta-3-aarch64-apple-darwin' - - Adding component forc-wallet v0.1.3 to 'beta-3-aarch64-apple-darwin' - Fetching binary from https://github.com/FuelLabs/forc-wallet/releases/download/v0.1.3/forc-wallet-0.1.3-aarch64-apple-darwin.tar.gz - Unpacking and moving forc-wallet to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Installed forc-wallet v0.1.3 for toolchain 'beta-3-aarch64-apple-darwin' - - Adding component fuel-core v0.17.1 to 'beta-3-aarch64-apple-darwin' - Fetching binary from https://github.com/FuelLabs/fuel-core/releases/download/v0.17.1/fuel-core-0.17.1-aarch64-apple-darwin.tar.gz - Unpacking and moving fuel-core to /Users/user/.fuelup/toolchains/ beta-3-aarch64-apple-darwin/bin - Installed fuel-core v0.17.1 for toolchain 'beta-3-aarch64-apple-darwin' - - Adding component fuel-indexer v0.2.3 to 'beta-3-aarch64-apple-darwin' - Fetching binary from https://github.com/FuelLabs/fuel-indexer/releases/download/v0.2.3/fuel-indexer-0.2.3-aarch64-apple-darwin.tar.gz - Unpacking and moving fuel-indexer to /Users/user/.fuelup/toolchains/beta-3-aarch64-apple-darwin/bin - Installed fuel-indexer v0.2.3 for toolchain 'beta-3-aarch64-apple-darwin' - - Installed: - - forc 0.35.0 - - forc-explore 0.28.1 - - forc-wallet 0.1.3 - - fuel-core 0.17.1 - - fuel-indexer 0.2.3 - - The Fuel toolchain is installed and up to date - ``` - -You're all set to start building! - -### Need Help? - -You may refer to [The Fuelup Book](https://fuellabs.github.io/fuelup/latest/) for an in-depth look into fuelup, or check out the tooling section in the [Fuel forum](https://forum.fuel.network/) if you're running into problems through the installation process. If you don't see your question, post the issue you're running into with as many details as possible and the team will get back to you asap! - -### Installing from Cargo - -The Sway toolchain and Fuel Core full node can be installed from source with Cargo with: - -```sh -cargo install forc fuel-core -``` - -#### Updating `forc` from Cargo - -You can update the toolchain from source with Cargo with: - -```sh -cargo update forc fuel-core -``` - -#### Installing `forc` Plugins from Cargo - -The Fuel ecosystem has a few plugins which can be easily installed via Cargo. - -> **Note**: `forc` detects anything in your `$PATH` prefixed with `forc-` as a plugin. Use `forc plugins` to see what you currently have installed. - -```sh -# Sway Formatter -cargo install forc-fmt - -# Block Explorer -cargo install forc-explore - -# Sway Language Server -cargo install forc-lsp -``` - -## Installing from Source - -Rather than installing from `cargo`, the Sway toolchain can be built from a local source checkout by following instructions at . The Fuel Core full node implementation can be built from source by following instructions at . - -## Enable tab completion for Bash, Fish, Zsh, or PowerShell - -`forc` supports generating completion scripts for Bash, Fish, Zsh, and PowerShell. See `forc completions --help` for full details, but the gist is as simple as using one of the following: - -```sh -# Bash -forc completions --shell=bash > ~/.local/share/bash-completion/completions/forc - -# Bash (macOS/Homebrew) -forc completions --shell=bash > $(brew --prefix)/etc/bash_completion.d/forc.bash-completion - -# Fish -mkdir -p ~/.config/fish/completions -forc completions --shell=fish > ~/.config/fish/completions/forc.fish - -# Zsh -forc completions --shell=zsh > ~/.zfunc/_forc - -# PowerShell v5.0+ -forc completions --shell=powershell >> $PROFILE.CurrentUserCurrentHost -# or -forc completions --shell=powershell | Out-String | Invoke-Expression -``` - -Once the completions have been generated and properly installed, close and reopen your terminal for the new completions to take effect. +Please visit the Fuel's [installation guide](https://docs.fuel.network/guides/installation) to install The Fuel toolchain binaries and pre requisites. \ No newline at end of file From 2a7e6ac1dd0481b9726da0e7dcb552323d460ed0 Mon Sep 17 00:00:00 2001 From: cold-briu Date: Fri, 6 Oct 2023 21:49:03 -0500 Subject: [PATCH 2/5] docs: Link developer quickstart to docs-hub --- docs/book/src/introduction/sway_quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/introduction/sway_quickstart.md b/docs/book/src/introduction/sway_quickstart.md index 14dd97a0a1f..39ca5e7bfac 100644 --- a/docs/book/src/introduction/sway_quickstart.md +++ b/docs/book/src/introduction/sway_quickstart.md @@ -1,3 +1,3 @@ # Sway Quickstart -Check out the [Developer Quickstart Guide](https://fuelbook.fuel.network/master/quickstart/developer-quickstart.html) for a step-by-step guide on building a fullstack dapp on Fuel. The guide will walk you through writing a smart contract, setting up a wallet, and building a frontend to interact with your contract. +Check out the [Developer Quickstart Guide](https://docs.fuel.network/guides/quickstart/) for a step-by-step guide on building a fullstack dapp on Fuel. The guide will walk you through writing a smart contract, setting up a wallet, and building a frontend to interact with your contract. From 5813723b96dc12df6eeac6b0af907de5794bcd77 Mon Sep 17 00:00:00 2001 From: cold-briu Date: Fri, 6 Oct 2023 22:00:58 -0500 Subject: [PATCH 3/5] docs: fix lint err --- docs/book/src/introduction/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/introduction/installation.md b/docs/book/src/introduction/installation.md index 609a76de162..11cbb31a1d4 100644 --- a/docs/book/src/introduction/installation.md +++ b/docs/book/src/introduction/installation.md @@ -2,4 +2,4 @@ ## The `Fuel` toolchain -Please visit the Fuel's [installation guide](https://docs.fuel.network/guides/installation) to install The Fuel toolchain binaries and pre requisites. \ No newline at end of file +Please visit the Fuel's [installation guide](https://docs.fuel.network/guides/installation) to install The Fuel toolchain binaries and pre requisites. From d33654be98657fa0002166a4c88794faef3d9334 Mon Sep 17 00:00:00 2001 From: cold-briu <39354014+cold-briu@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:03:27 -0500 Subject: [PATCH 4/5] docs: book - merge installation and quickstart --- docs/book/src/SUMMARY.md | 3 +-- docs/book/src/introduction/fuel_toolchain.md | 2 +- .../{sway_quickstart.md => getting_started.md} | 8 +++++++- docs/book/src/introduction/index.md | 3 +-- docs/book/src/introduction/installation.md | 5 ----- 5 files changed, 10 insertions(+), 11 deletions(-) rename docs/book/src/introduction/{sway_quickstart.md => getting_started.md} (56%) delete mode 100644 docs/book/src/introduction/installation.md diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index d33acfa8e8d..a774fb703e2 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -3,8 +3,7 @@ [The Sway Programming Language](./index.md) - [Introduction](./introduction/index.md) - - [Installation](./introduction/installation.md) - - [Sway Quickstart](./introduction/sway_quickstart.md) + - [Getting Started](./introduction/getting_started.md) - [The Fuel Toolchain](./introduction/fuel_toolchain.md) - [A Forc Project](./introduction/forc_project.md) - [Standard Library](./introduction/standard_library.md) diff --git a/docs/book/src/introduction/fuel_toolchain.md b/docs/book/src/introduction/fuel_toolchain.md index 14534a48d40..3ec3289a73b 100644 --- a/docs/book/src/introduction/fuel_toolchain.md +++ b/docs/book/src/introduction/fuel_toolchain.md @@ -12,7 +12,7 @@ The Sway Language Server `forc-lsp` is provided to expose features to IDEs. [Ins ## Sway Formatter (`forc-fmt`) -A canonical formatter is provided with `forc-fmt`. [Installation instructions](./installation.md). It can be run manually with +A canonical formatter is provided with `forc-fmt`. [Installation instructions](./getting_started.md). It can be run manually with ```sh forc fmt diff --git a/docs/book/src/introduction/sway_quickstart.md b/docs/book/src/introduction/getting_started.md similarity index 56% rename from docs/book/src/introduction/sway_quickstart.md rename to docs/book/src/introduction/getting_started.md index 39ca5e7bfac..f5ebae27e42 100644 --- a/docs/book/src/introduction/sway_quickstart.md +++ b/docs/book/src/introduction/getting_started.md @@ -1,3 +1,9 @@ -# Sway Quickstart +# Getting Started + +## Installing the `Fuel` toolchain + +Please visit the Fuel [Installation Guide](https://docs.fuel.network/guides/installation) to install the Fuel toolchain binaries and pre requisites. + +## Sway Quickstart Check out the [Developer Quickstart Guide](https://docs.fuel.network/guides/quickstart/) for a step-by-step guide on building a fullstack dapp on Fuel. The guide will walk you through writing a smart contract, setting up a wallet, and building a frontend to interact with your contract. diff --git a/docs/book/src/introduction/index.md b/docs/book/src/introduction/index.md index d90d34bd12a..353fb3cb872 100644 --- a/docs/book/src/introduction/index.md +++ b/docs/book/src/introduction/index.md @@ -2,8 +2,7 @@ To get started with Forc and Sway smart contract development, install the Fuel toolchain and Fuel full node and set up your first project. -- [Installation](./installation.md) -- [Sway Quickstart](./sway_quickstart.md) +- [Getting Started](./getting_started.md) - [The Fuel Toolchain](./fuel_toolchain.md) - [A Forc Project](./forc_project.md) - [Standard Library](./standard_library.md) diff --git a/docs/book/src/introduction/installation.md b/docs/book/src/introduction/installation.md deleted file mode 100644 index 11cbb31a1d4..00000000000 --- a/docs/book/src/introduction/installation.md +++ /dev/null @@ -1,5 +0,0 @@ -# Installation - -## The `Fuel` toolchain - -Please visit the Fuel's [installation guide](https://docs.fuel.network/guides/installation) to install The Fuel toolchain binaries and pre requisites. From 8417f0300dfe0179ad98bb36bb82cd932d01c99c Mon Sep 17 00:00:00 2001 From: cold-briu <39354014+cold-briu@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:30:03 -0500 Subject: [PATCH 5/5] docs: book fix typo --- docs/book/src/introduction/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/introduction/getting_started.md b/docs/book/src/introduction/getting_started.md index f5ebae27e42..ca9915483d8 100644 --- a/docs/book/src/introduction/getting_started.md +++ b/docs/book/src/introduction/getting_started.md @@ -2,7 +2,7 @@ ## Installing the `Fuel` toolchain -Please visit the Fuel [Installation Guide](https://docs.fuel.network/guides/installation) to install the Fuel toolchain binaries and pre requisites. +Please visit the Fuel [Installation Guide](https://docs.fuel.network/guides/installation) to install the Fuel toolchain binaries and prerequisites. ## Sway Quickstart