手把手教你搭建Facebook区块链Libra的开发环境
123458254
发表于 2023-1-8 10:01:17
137
0
0
安装Move项目开发环境 v" M7 m% a) G4 o* r1 F* I
1.打开https://developers.libra.org/docs/my-first-transaction网站,并使用git命令克隆项目8 [: g: d/ m6 h5 C- {
git clone https://github.com/libra/libra.git5 W6 Z0 ?( ?/ G( A
2.配置yum源5 R2 Z- k5 M2 `2 E
使用以下命令,配置yum源4 a* C) N7 l4 i6 F
sudo gedit fedora-163.repo
sudo gedit fedora-updates-163.repo
其中fedora-163.repo文件的内容如下,直接贴过去即可
?948 ?sudo unzip -o protoc-3.9.0-linux-x86_64.zip -d /usr/local bin/protoc
? 950 ?sudo unzip -o protoc-3.9.0-linux-x86_64.zip -d /usr/local include/*
fedora-updates-163.repo文件的内容如下:* H) m, L' ~2 P! q
[updates]5 x3 y. A& M% l4 T) Z/ C8 }
name=Fedora 17 - $basearch - Updates - 163.com
failovermethod=priority
baseurl=http://mirrors.163.com/fedora/updates/17/$basearch/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f17&arch=$basearch. i# H) p, Z/ e6 Y* L( k* v: ]
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch0 f# A4 e' k# U3 |. y. h/ M3 g: r
[updates-debuginfo]) R/ k k0 V8 |1 {
name=Fedora 17 - $basearch - Updates - Debug - 163.com
failovermethod=priority
baseurl=http://mirrors.163.com/fedora/updates/17/$basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f17&arch=$basearch
enabled=0
gpgcheck=0) x2 Q4 ]8 J; O! T: h U. H
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[updates-source]5 ]& O! ^5 W# ]" m h
name=Fedora 17 - Updates Source - 163.com
failovermethod=priority5 f# @2 [' P$ E5 `
baseurl=http://mirrors.163.com/fedora/updates/17/SRPMS/+ D- g6 ^3 y5 o! }5 Y Z
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f17&arch=$basearch+ a6 j4 i q0 [4 b
enabled=0( Z) U; l' c# v. M
gpgcheck=0. ]3 m; [" t" A) I
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
使用以下命令,重新配置yum源:5 p! } p6 H7 s- d* ]% R% Z
yum makecache7 _3 Q0 |' P. Z a5 p
yum repolist all' J3 T/ h* l! y: _
看到有如下返回,就大成告成了。- @! w( l! m0 y1 K; M
repo id repo name status D2 \& d5 T ?/ L3 x6 l
fedora Fedora 17 - x86_64 - 163.com enabled: 27,0339 I9 X5 ?- G3 |( H! v
fedora-debuginfo Fedora 17 - x86_64 - Debug - 163.com disabled3 P! h- r6 |( K9 B, @
fedora-source Fedora 17 - Source - 163.com disabled E3 t+ ^# v" P& R/ [( ~
updates Fedora 17 - x86_64 - Updates - 163.com enabled: 13,163
updates-debuginfo Fedora 17 - x86_64 - Updates - Debug - 163.com disabled
updates-source Fedora 17 - Updates Source - 163.com disabled" c- b' F ], ]5 @: v4 c2 u
repolist: 40,196
3.安装protoc( Y! L; H. \7 L% k
使用以下命令安装protoc: Y8 f+ I/ M. c
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protoc-3.8.0-linux-x86_64.zip( g4 H; Y$ X5 R' x! L& s
sudo unzip -o protoc-3.8.0-linux-x86_64.zip -d /usr/local bin/protoc; T/ _ v; w8 o. a# ]
sudo unzip -o protoc-3.8.0-linux-x86_64.zip -d /usr/local include/*
4.安装Go语言( H1 G. t: @0 d8 G! B9 J
使用以下命令安装Go语言
sudo apt-get install golang
5.安装Libra Core环境' D5 t4 {$ @; B% b9 |
使用以下命令配置LibraCore. a8 j- s. J2 C$ c1 _, }
cd libra) c& w- k: a# ]) M; ? [4 L
./scripts/dev_setup.sh
第一个Libra的“hello world"项目. I/ j4 ^' L9 X% H2 e0 C
使用以下命令,进入libra的开发环境
./scripts/cli/start_cli_testnet.sh% b3 @ p2 n7 D: O' L7 i
进入到libra的命令行, F8 I2 ]5 K5 q% }" o
使用以下命令就可以创造你第一个帐户了9 u+ A9 v# O& r% G0 B' j1 E
create | c
成为第一个吐槽的人