Skip to main content

Setting up your environment

In this section we will install all the requirements needed for the practical sessions. This includes the following:

  • rustup - The Rust toolchain installer
  • sc-meta - universal smart contract management tool
  • (Optional) mxpy - tool for interacting with the blockchain
  • (Optional) MetaMask - Ethereum wallet

Rustup - The Rust toolchain installer

Rust is installed and managed by the rustup tool. If you've installed rustup in the past, you can update your installation by running rustup update.

For more informantion, please check rustup documentation.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Configuring the PATH environment variable

In the Rust development environment, all tools are installed to the ~/.cargo/bin directory, and this is where you will find the Rust toolchain, including rustc, cargo, and rustup.

During installation rustup will attempt to configure the PATH. Because of differences between platforms, command shells, and bugs in rustup, the modifications to PATH may not take effect until the console is restarted, or the user is logged out, or it may not succeed at all.

Please make sure you have included ~/.cargo/bin directory in your PATH environment variable.

Please verify that rustup was succesffully install with rustup --version.

Uninstall Rust

If at any point you would like to uninstall Rust, you can run rustup self uninstall.

MultiversX prerequisites

mxpy

Mxpy is a tool for interaction with the blockchain:

----------------------
COMMAND GROUPS summary
----------------------
contract Build, deploy, upgrade and interact with Smart Contracts
tx Create and broadcast Transactions
validator Stake, UnStake, UnBond, Unjail and other actions useful for Validators
account Get Account data (nonce, balance) from the Network
ledger Get Ledger App addresses and version
wallet Create wallet, derive secret key from mnemonic, bech32 address helpers etc.
deps Manage dependencies or multiversx-sdk modules
config Configure multiversx-sdk (default values etc.)
localnet Set up, start and control localnets
data Data manipulation omnitool
staking-provider Staking provider omnitool
dns Operations related to the Domain Name Service

Before installing mxpy, please make sure you have a working Python 3 environment. You'll need Python 3.8 or later on Linux or MacOS.

The recommended way to install mxpy is by using pipx. If you'd like to use mxpy on Windows, we recommend installing it within the Windows Subsystem for Linux (WSL).

In order to install mxpy using pipx, run the following command:

pipx install multiversx-sdk-cli --force

To check that mxpy installed successfully you can run the following command:

mxpy --version

wasm32-unknown-unknown

This is WebAssembly target which uses 32-bit memories. It is used to compile MultiversX smart contracts to WebAssembly.

To add it, please use:

rustup target add wasm32-unknown-unknown

sc-meta

This tool is used to compile smart contracts.

To install it, run:

cargo install multiversx-sc-meta --locked

To verify that it's correctly installed, run:

sc-meta --version