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
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-coreIcon Link for common platforms.
To install the Fuel toolchain, you can 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 https://install.fuel.network | sh
Icon InfoCircle
🚧 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 you with the question below:
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/.bashrcWould 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.
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 datefuelup 0.20.0 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.
Just as in Rust Icon Link, 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.
The default toolchain configured when you install fuelup is the latest toolchain, which is the stable toolchain compatible with the current beta-5 network.
Make sure you have the latest version of fuelup so you can access 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.gzDownloading component fuelup without verifying checksumUnpacking and moving fuelup to /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHtMoving /var/folders/tp/0l8zdx9j4s9_n609ykwxl0qw0000gn/T/.tmpiNJQHt/fuelup to /Users/.fuelup/bin/fuelup
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.
The forc-wallet plugin is packaged alongside the default distributed toolchains when installed using fuelup, so you should already have this installed if you've followed the instructions above.
To initialize a new wallet with forc-wallet, you can run the command below:
forc wallet new
After typing in a password, be sure to save the mnemonic phrase that is output.
Next, create a new wallet account with:
forc wallet account new
With this, you'll get a fuel address that looks something like this: fuel1efz7lf36w9da9jekqzyuzqsfrqrlzwtt3j3clvemm6eru8fe9nvqj5kar8.
If you need to list your accounts, you can run the command below: