# Venus 组件构建

本文档各组件以 TAG:v1.0.0 为例说明,实际场景中按需检出.

每个组件的构建相互独立,无顺序之分.

# 环境准备

系统需要安装 Go,Rust等必要软件,可以参考 lotus 文档中的相应部分 building-from-source (opens new window)

Venus 组件均在 github 开源,通常用 git 管理, git 命令使用可参考 Branching-Remote-Branches (opens new window)

部分组件依赖filecoin-ffi, Filecoin官方提供了编译好的静态库文件.如果需要源码编译此静态库,可参考 native-filecoin-ffi (opens new window),通常venus-clustervenus-sealer源码编译此库以提升扇区封装效率.

# venus-auth

$ git clone https://github.com/filecoin-project/venus-auth.git
$ cd venus-auth
$ git checkout -b v1.0.0 v1.0.0
$ make 

# venus

$ git clone https://github.com/filecoin-project/venus.git
$ cd venus
$ git checkout -b v1.0.0 v1.0.0
$ git submodule update --init --recursive
$ make deps
$ make

# venus-gateway

$ git clone https://github.com/ipfs-force-community/venus-gateway.git
$ cd venus-gateway
$ git checkout -b v1.0.0 v1.0.0
$ git submodule update --init --recursive
$ make

如果遇到编译错误: github.com/dgraph-io/badger/v3@v3.2011.1/fb/BlockOffset.go:6:2: missing go.sum entry for module providing package github.com/google/flatbuffers/go (imported by github.com/dgraph-io/badger/v3/table); to add: go get github.com/dgraph-io/badger/v3/table@v3.2011.1 ,先执行:

$ go get github.com/google/flatbuffers@v1.12.1

# venus-messager

$ git clone https://github.com/filecoin-project/venus-messager.git
$ cd venus-messager
$ git checkout -b v1.0.0 v1.0.0
$ make 

# venus-miner

$ git clone https://github.com/filecoin-project/venus-miner.git
$ cd venus-miner
$ git checkout -b v1.0.0 v1.0.0
$ git submodule update --init --recursive
$ make

# venus-market

参考 venus-market 项目的 readme 文档中 Build (opens new window)

# venus-wallet

参考 venus-wallet 项目的 readme 文档中 Build (opens new window)

# venus-cluster

参考 venus-cluster 项目的文档 05.快速启用.md准备工作 (opens new window)

# venus-sealer(将弃用)

$ git clone https://github.com/filecoin-project/venus-sealer.git
$ cd venus-sealer
$ git checkout -b v1.0.0 v1.0.0
$ git submodule update --init --recursive
$ make deps
$ make