Move development environment setup (Windows version)

Foreword:

Because the programming language Move can only be developed on a Unix-like system at present, and I neither have a mac computer, nor do I want to install the ubuntu system on the vm tool, and then develop it like a doll. Therefore, this article will teach you how to build a Move development environment on window 11.

Key words:

Windows11, Move development environment, WSL2, VScode, Layer1, Aptos

Windows 11 system installs WSL2.

After the installation is complete, simply play it on the command line. If there is no problem, it proves that WSL2 is installed successfully.

Build a vscode development environment

First download the vscode plug-in remote-wsl, which can easily manage and upload files to the subsystem ubuntu. It can be said that it is a very useful vscode plug-in to experience the programming feeling under linux on windows.

After the installation is complete, open the window and let our vscode development interface connect to our linux environment. When you open it for the first time, the system will automatically download the relevant dependent environment. Therefore, you need to have a stable network environment, and it is best to have a ladder.

After the window opens, enter a simple command to see if the connection is successful. At this point, the installation and debugging of WSL2 is completed.

1. Install move development environment

1、安装rust开发环境
curl --proto '=https' --tlsv1.2 -sSf <https://sh.rustup.rs> | sh

#检查是否安装成功
cargo --version
rustc -V        # 注意的大写的 V

After the installation is complete, you need to close the window and reopen it to take effect.

2. Install move-cli scaffolding

cargo install --git https://github.com/move-language/move move-cli --branch main

$ move
Move 0.1.0

If the process of installing scaffolding is very slow and the download speed is only a dozen kb/s, then you need to set a proxy for WSL2. The process of setting up a proxy is simple.

//编写一个脚本  vi proxyrc
#!/bin/bash
host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
export ALL_PROXY="http://$host_ip:7890"

//让脚本生效
source proxyrc

The effect is immediate.

The process of installing move-cli took a total of 2 hours. After the installation is complete, enter Move to check whether the installation is successful.

ouhuang@LAPTOP-HM465BTT:~$ move
move-cli 0.1.0
Diem Association <[email protected]>
MoveCLI is the CLI that will be executed by the `move-cli` command The `cmd` argument is added here
rather than in `Move` to make it easier for other crates to extend `move-cli`

So far, the move development environment has been installed successfully.

References

Guess you like

Origin blog.csdn.net/smartContractXH/article/details/127015280