This guide will help you to install the Fuel toolchain binaries and pre requisites.
This guide covers the following topics:
The Fuel toolchain is built on top of the Rust programming language. To install Rust, you can use the rustup
tool.
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.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Check the official Rust documentation to get more information on installing the Rust toolchain .
fuelup
is the official package manager for Fuel that installs the Fuel toolchain
from the official release channels, enabling you to easily switch between different
toolchains and keep them updated. It makes building and maintaining Sway applications
simpler with forc and fuel-core for common platforms.
💡 Check out the Fuelup docs for more information.
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
.
👉 Just paste the following line in your terminal and press Enter.
curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh
🚧 Be aware that currently we do not natively support Windows. If you wish to use
fuelup
on Windows, please use Windows Subsystem for Linux.
Once the script is downloaded it will be executed automatically. The fuelup-init
script will prompt something as this.
fuelup uses "/home/username/.fuelup" as its home directory to manage the Fuel toolchain, and will install binaries there.
To use the toolchain, you will have to configure your PATH, which tells your machine where to locate fuelup and the Fuel toolchain.
If permitted, fuelup-init will configure your PATH for you by running the following:
echo "export PATH="$HOME/.fuelup/bin:$PATH"" >> /home/username/.bashrc
Would you like fuelup-init to modify your PATH variable for you? (N/y)
👉 If this is your first time installing the Fuel toolchain just press the Y
key in your terminal and press Enter
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:
The Fuel toolchain is installed and up to date
fuelup 0.19.5 has been installed in /home/username/.fuelup/bin.
To fetch the latest toolchain containing the forc and fuel-core binaries, run 'fuelup toolchain install latest'.
To generate completions for your shell, run 'fuelup completions --shell=SHELL'.
👉 Use fuelup --version
any time to check which version of the package you are using.
fuelup --version
That will output your current fuelup
verison:
fuelup 0.19.5
Just as seen in rust Fuel supports multiple toolchains. A toolchain is a collection of tools (such as the compiler, lsp, etc). By default, Fuelup includes a series of toolchain with packages tested to work with each other, providing a realiable 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 page.
Make sure you have the latest version of fuelup
so you can accesses the latest features and have the best performance.
👉 Update fuelup
by running the following command:
fuelup self update
Then you will get an output like this:
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
Unpacking and moving fuelup to /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHt
Moving /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHt/fuelup to /Users/.fuelup/bin/fuelup
The beta-4
network is the latest Fuel testnet. This includes public infrastructure such a the Beta-4 faucet and the Beta-4 GraphQL endpoint .
To properly interact with the beta-4
network is necessary to use it's corresponding toolchain.
👉 Run the following command to install the beta-4
:
fuelup toolchain install beta-4
If the toolchain was successfully installed, you will see this output:
The Fuel toolchain is installed and up to date
The toolchain was installed correctly, however is in use yet. You need to indicate fuelup
to use the beta-4
toolchain.
👉 set the beta-4
as your default toolchain with the following command:
fuelup default beta-4
You will get the following output indicating that you are ready to go.
default toolchain set to 'beta-4'
Sometimes you might end up using multiples toolchain at once, don't worry if you get confused about wich toolchain your are using since you can check your current toolchain anytime.
👉 Run the fuelup show
command to see toolchain that your are using and the version of the binaries of that toolchain.
fuelup show
This command will give you the following output
active toolchain
-----------------
beta-4-x86_64-unknown-linux-gnu (default)
forc : 0.45.0
- forc-client
- forc-deploy : 0.45.0
- forc-run : 0.45.0
- forc-doc : 0.45.0
- forc-explore : 0.28.1
- forc-fmt : 0.45.0
- forc-index : 0.20.7
- forc-lsp : 0.45.0
- forc-tx : 0.45.0
- forc-wallet : 0.3.0
fuel-core : 0.20.4
fuel-core-keygen : Error getting version string
fuel-indexer : 0.20.7
fuels versions
---------------
forc : 0.45
forc-wallet : 0.45
As you can see the beta-4 toolchain is active 🚀
Now you are ready to start building with Fuel.
👉 Check out the quickstart guide to deploy your first smart contract.
You can create your own set of specific versions, this is known as 'custom toolchains'.
👉 Visit the Fuelup docs to learn how to set up your own custom toolchains.
You can always build the Fuel packages from source.
👉 visit the Fuelup docs to get more details other types of installation.
It's always possible to run a developement enviroment on the browser.
👉 Please visit our guide on Github Codespaces to use the Fuel Toolchain on the browser.
Was this page helpful?