Skip to content

Commit

Permalink
Merge pull request #841 from multiversx/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
iulianpascalau committed Feb 28, 2024
2 parents a83dc20 + b96943f commit f233a25
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 32 deletions.
54 changes: 25 additions & 29 deletions docs/sdk-and-tools/sdk-py/installing-mxpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ title: Installing mxpy

This page describes how to install **mxpy** (the CLI tool). The recommended way to install **mxpy** is by using **pipx**. If you want to learn more about **pipx** you can check out [this page](https://pipx.pypa.io/stable/#overview-what-is-pipx).

**mxpy** is currently supported on Linux and MacOS. Some of its features might work on Windows as well, although using **mxpy** on Windows is neither recommended, nor supported at this time.
:::note
If you'd like to use **mxpy** on Windows, we recommend installing it within the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install). If you experience an issue, please follow the [troubleshooter](/sdk-and-tools/troubleshooting/multiplatform).
:::

[comment]: # (mx-context-auto)

Expand All @@ -23,27 +25,39 @@ Before installing **mxpy**, please make sure you have a working **Python 3** env
Keep in mind that installing using **pipx** is only available for **mxpy v9.2.0** or later.
:::

You'll need **pipx** installed on your machine. For more details on how to install **pipx** check out [this page](https://pipx.pypa.io/stable/#install-pipx).
You'll need **pipx** installed on your machine. For more details on how to install **pipx** check out [**this page**](https://pipx.pypa.io/stable/#install-pipx).

:::note
If you've previously installed **mxpy** using **mxpy-up** and you'd like to switch to **pipx**, make sure to remove the old `mxpy` shortcut and virtual Python environment beforehand:

```sh
rm ~/multiversx-sdk/mxpy
rm -rf ~/multiversx-sdk/mxpy-venv
```
:::

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

```sh
pipx install multiversx-sdk-cli
pipx install multiversx-sdk-cli --force
```

This will simply install the latest version available.

In case you want to install a specific version you should also specify the version.

```sh
pipx install multiversx-sdk-cli==9.2.0
pipx install multiversx-sdk-cli==9.5.1
```

You can also install **mxpy** directly from a GitHub branch. Replace `branch_name` with your desired branch and run the following command:

```sh
pipx install git+https://github.com/multiversx/mx-sdk-py-cli@branch_name
```

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

```sh
mxpy --version
```
Expand All @@ -53,6 +67,7 @@ mxpy --version
## **Upgrade mxpy using pipx**

To upgrade **mxpy** to a newer version you can simply run the following command:

```sh
pipx upgrade multiversx-sdk-cli
```
Expand All @@ -61,32 +76,13 @@ pipx upgrade multiversx-sdk-cli

## **Install using mxpy-up**

In order to install **mxpy** using the `mxpy-up` script, run the following commands:

```
wget -O mxpy-up.py https://raw.githubusercontent.com/multiversx/mx-sdk-py-cli/main/mxpy-up.py
python3 mxpy-up.py
```
Installing **mxpy** using **mxpy-up** is not recommended anymore. We recommend using **pipx** instead.

Running the above will create a Python virtual environment in `~/multiversx-sdk/mxpy-venv`, it will install the package [`multiversx-sdk-cli`](https://pypi.org/project/multiversx-sdk-cli) into this environment, and it will create the shortcut `~/multiversx-sdk/mxpy`.
If you've previously installed **mxpy** using **mxpy-up** and you'd like to switch to **pipx**, make sure to remove the old `mxpy` shortcut and virtual Python environment beforehand:

The `mxpy` shortcut is not automatically added to your **`$PATH`** environment variable, so **you'll need to configure that manually** (see below).

[comment]: # (mx-context-auto)

## Make mxpy available in your shell

In order to have the **mxpy** shortcut available in the shell after installation, you'll need to manually include `~/multiversx-sdk` in your **`$PATH`** environment variable by editing the appropriate shell profile file: `~/.bashrc` (for Bash) or `~/.zshrc` (for Zsh).

For example:

```
echo "export PATH="\$HOME/multiversx-sdk:\$PATH"" >> ~/.bashrc
echo "export PATH="\$HOME/multiversx-sdk:\$PATH"" >> ~/.zshrc
```sh
rm ~/multiversx-sdk/mxpy
rm -rf ~/multiversx-sdk/mxpy-venv
```

Then, open a new shell and run the following to verify that **mxpy** is installed correctly:

```
mxpy --version
```
Additionally, you might want to cleanup the shell profile files, to not alter anymore the `PATH` variable with respect to `~/multiversx-sdk`: `~/.profile`, `~/.bashrc` and / or `~/.zshrc`.
50 changes: 50 additions & 0 deletions docs/sdk-and-tools/troubleshooting/multiplatform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: multiplatform
title: MultiversX tools on multiple platforms
---

Generally speaking, the MultiversX tools should work on all platforms. However, platform-specific issues can occur. This page aims to be an entry point for troubleshooting platform-specific issues, in regards to the MultiversX toolset.

:::note
If you discover a platform-specific issue, please let us known, on the [corresponding GitHub repository](/sdk-and-tools/overview).

If you are blocked by a platform-specific issue, please consider using a **devcontainer**, as described [here](/sdk-and-tools/devcontainers).
:::

## Linux

All tools are expected to work on Linux. They are generally tested on Ubuntu-based distributions.

## MacOS

All tools are expected to work on MacOS. Though, even if the tests within the continous integration flows cover MacOS, some inconveniences might still occur.

### Apple Silicon (M1, M2)

As of February 2024, the Node can only be compiled using the AMD64 version of Go. Thus, dependent tools, such as [localnets](/developers/setup-local-testnet.md), the [Chain Simulator](/sdk-and-tools/chain-simulator.md) etc. will rely on the [Apple Rosetta binary translator](https://en.wikipedia.org/wiki/Rosetta_(software)).

:::note
As of February 2024, a native ARM64 version of the Node is in the works. This will allow the dependent tools to run natively on Apple Silicon.
:::

If you'd like to manually build a Go tool that only works on AMD64 (for now), download & extract the Go toolchain for AMD64. For example:

```sh
wget https://go.dev/dl/go1.20.7.darwin-amd64.tar.gz
tar -xf go1.20.7.darwin-amd64.tar.gz
```

Then, export `GOPATH` and `GOENV` variables into your shell:

```sh
export GOPATH=/(path to extracted toolchain)/go
export GOENV=/(path to extracted toolchain)/go/env
```

Afterwards, build the tools, as needed. The obtained binaries will be AMD64, and they will run on your ARM64 system.

## Windows

Some tools can be difficult to install or run **directly on Windows**. For example, when building smart contracts, the encountered issues might be harder to tackle, especially for beginners.

Therefore, we recommend using the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install), instead of running the tools directly on Windows.
4 changes: 2 additions & 2 deletions docs/validators/system-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Nodes are computers running the MultiversX software, so they contribute to the M

## **Minimum System Requirements for running 1 MultiversX Node**

- 4 x dedicated/physical CPUs, either Intel or AMD, with the `SSE4.1` and `SSE4.2` flags (use [lscpu](https://manpages.ubuntu.com/manpages/trusty/man1/lscpu.1.html) to verify)
- 4 x dedicated cores (or vCPUs), either Intel or AMD, with the `SSE4.1` and `SSE4.2` flags (use [lscpu](https://manpages.ubuntu.com/manpages/trusty/man1/lscpu.1.html) to verify)
- 8 GB RAM
- 200 GB SSD
- 100 Mbit/s always-on internet connection, at least 4 TB/month data plan
Expand All @@ -28,7 +28,7 @@ Support for ARM processors (e.g. for Raspberry Pi) will come in the future, pend
:::

:::caution
If the system chosen to host the node is a VPS, the host should have dedicated CPUs. This is mandatory. Using shared CPUs can hinder your node's performance that will result in a decrease of node's rating and eventually the node might get jailed.
If the system chosen to host the node is a VPS, the host should have dedicated vCPUs. This is mandatory. Using shared vCPUs can hinder your node's performance that will result in a decrease of node's rating and eventually the node might get jailed.
:::

:::tip
Expand Down
3 changes: 2 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ const sidebars = {
items: [
"sdk-and-tools/troubleshooting/troubleshooting",
"sdk-and-tools/troubleshooting/rust-setup",
"sdk-and-tools/troubleshooting/ide-setup"
"sdk-and-tools/troubleshooting/ide-setup",
"sdk-and-tools/troubleshooting/multiplatform",
],
}
],
Expand Down

0 comments on commit f233a25

Please sign in to comment.