Move dev-Tutorial【#0 Install Move Language安装Move语言】

本文是学习笔记,供自己知识整理和分享经验

Move语言目前是最火热的区块链开发语言,由Meta公司开发,详细信息不做赘述,可以查看github上官方的定义和特性描述。

Move is a programming language for writing safe smart contracts originally developed at Facebook to power the Diem blockchain. Move is designed to be a platform-agnostic language to enable common libraries, tooling, and developer communities across diverse blockchains with vastly different data and execution models. Move's ambition is to become the "JavaScript of web3" in terms of ubiquity--when developers want to quickly write safe code involving assets, it should be written in Move.

https://github.com/move-language/move

推荐在Linux环境下进行开发。

笔者的环境是

操作系统:Windows 11 22H2 - WSL【Ubuntu 22.04】

编辑器:VS Code 1.72.2

在win11下运行VS Code,设置为Running in Ubuntu 22.04(WSL 2),这么做的原因,是可以在Windows上使用编辑器更顺手,但同时可以用Linux环境来编译和执行、部署。

post image

Installation 安装

Step 0 : clone

git clone https://github.com/move-language/move.git
从git克隆move源码
从git克隆move源码

Step 1:执行安装

cd move ./scripts/dev_setup.sh -ypt

执行安装
执行安装

这个时候会遇到第一个坑。

Move语言是基于Rust开发,So,并且需要rust语言的cargo来build整个move

否则安装会执行失败

Move需要依赖的列表中,我的系统环境下缺失:

  • OpenSSL libssl-dev

  • rust

安装rust、cargo、libssl-dev

#Rust & Cargo curl https://sh.rustup.rs -sSf | sh

#OpenSSL libssl-dev sudo apt-get install libssl-dev

安装rust and cargo
安装rust and cargo

continue 接着继续安装

source ~/.profile

cargo install --path language/tools/move-cli

这里开始使用rust的cargo build move-cli

build源码
build源码

如果遇到错误提示,可以看看是否是依赖项没有在你的系统有效安装。或者安装路径cargo不认识,都可以根据提示去配置文件中自定义path。具体哪个文件,需要看错误提示的内容。

安装成功
安装成功
move -help
move -help

Compete !安装完成

本文记录了整个Move语言在Linux环境下的安装以及重要依赖项的说明

接下来会开始继续整理基于VS Code的开发环境搭建以及Demo的运行

Thanks

0xES

Subscribe