Technical Guide - Install cargo contract
Prerequisites
Ubuntu system (This tutorial uses Ubuntu 22.04).
Sudo privileges.
Access to the command line.
Install Rust on Ubuntu using rustup
1. Download rustup
To get the latest available version of Rust, use the curl command to download the rustup shell script. The rustup tool allows users to manage Rust in a more straightforward way.
curl https://sh.rustup.rs -sSf | sh
Note: If you receive a "curl command not found" error message, it is likely that the curl package is not installed on your system. Install it by running sudo apt install curl
.
2. Type 1 to proceed with the default installation.
3. Restart the shell if necessary.
The system might not recognize the /.cargo/bin directory.)
4. Add Rust to PATH
Once the shell reboots, run the following to add Rust to the system PATH :
source "$HOME/.cargo/env"
5. Check the installation :
rustc -V
cargo --version
Install Cargo contrat
1. Install cargo-contract:
Install the cargo-contract, use the cargo command:
cargo install cargo-contract
Note: If you receive a ยซ linker cc
found ยป error message, it is likely that C linker is not installed on your system.
Install it by running :
sudo apt update && sudo apt upgrade
sudo apt install build-essential
Check the installation of cc linker:
g++ --version
When C Linker is installed, start again the installation :
cargo install cargo-contract
2. Check the installation :
cargo contract --version
Crypto-enthusiast, Defi & NFT believer, Dotsam Fam Astar Tech Amb & Phala Amb Web2 builder gradually migrating to Web3
Tutorials to write Smart Contracts in Rust and Ink!
0 comments