安装Rust (已经有的可以跳过)
首先,Move语言是Rust语言写的,需要先配置好Rust语言的环境
推荐配置:
安装Visual Studio 2022
点击修改
点开C++桌面开发
然后点击上方的语言包
请务必勾选英文
然后参考我朋友在交大源的Rust安装步骤
下载rustup之后,安装rust nightly
然后修改一下env,左边是变量右边是值
RUSTUP_DIST_SERVER https://mirror.sjtu.edu.cn/rust-static
RUSTUP_UPDATE_ROOT https://mirror.sjtu.edu.cn/rust-static/rustup
然后参考这个配置一下crates的源https://mirror.sjtu.edu.cn/docs/crates.io
安装Move
当rust配置好了之后重启一下电脑开始今天的主题:配置Move语言的开发环境
首先我们使用Rust去安装move-cli 和 move-analyzer
cargo install move-cli --git https://github.com/move-language/move
cargo install move-analyzer --git https://github.com/move-language/move move-analyzer
默认应该会安装到下方这个目录
C:\Users\你的用户名\.cargo\bin\
然后安装这个vscode插件
move.exe new hello
cd hello
code .
然后你就看到
稍微写点东西
然后你就能看到补全啊,高亮啊,之类的了~