Filecoin之环境安装

操作系统选择上,虽然官方提供了Arch、Ubuntu、Fedora、OpenSUSE等各种发行版示例,但考虑到国内实际情况,建议使用Ubuntu最新LTS版即20.04。
1、安装基础依赖库
$ sudo apt update
$ sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y
2、安装 Golang
# 下载golang安装包
$ wget -c https://golang.org/dl/go1.16.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
# GOPATH写入环境变量
$ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc && ~/.bashrc
# 国内网络环境,可以配置goproxy代理,否则编译会非常慢
# echo "export GOPROXY=https://goproxy.cn" >> $HOME/.profile
# 使环境变量生效
$ source $HOME/.profile
# 查看golang版本
$ go version
可直接运行本项目下的./scripts/install-golang.sh来安装Golang编译环境。
3、安装 Rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ chmod a+x ./rust-setup.sh
$ ./rust-setup.sh -y 
$ rm ./rust-setup.sh
$ source $HOME/.cargo/env
$ rustup default nightly
可直接运行本项目下的./scripts/install-rust.sh来安装Rust编译环境。
4、编译Lotus
$ git clone https://github.com/filecoin-project/lotus.git
$ cd lotus/
# 切换到当前的稳定版本
# 查看稳定版本: https://github.com/filecoin-project/lotus/tags
$ cd lotus
$ git fetch origin
$ git reset --hard v1.4.1
5、CPU优化
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1
export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
export CGO_CFLAGS="-D__BLST_PORTABLE__"
6、构建安装Lotus
$ make clean all
$ sudo make install
7、安装显卡驱动

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值