# build-lotus **Repository Path**: olier/build-lotus ## Basic Information - **Project Name**: build-lotus - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-05 - **Last Updated**: 2021-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 目录结构 ``` |- lotus |- rust-fil-proofs |- bellperson ``` ### 获取源码 ``` git clone https://github.com/filecoin-project/lotus.git cd lotus git submodule update --init --recursive ``` ### 更新 extern/filecoin-ffi ``` cd extern/filecoin-ffi git pull origin master git checkout d828994 ``` ### 修改 extern/filecoin-ffi/rust/Cargo.toml ``` [dependencies] ... bellperson = { version = "0.13", default-features = false, features = ["gpu"] } ... [dependencies.filecoin-proofs-api] package = "filecoin-proofs-api" version = "~6.1" default-features = false features = ["gpu2"] ... [features] default = ["pairing", "gpu2"] ... [patch.crates-io] bellperson = { path = "../../../../bellperson" } filecoin-proofs-v1 = { package = "filecoin-proofs", version = "~6.1", default-features = false, path = "../../../../rust-fil-proofs/filecoin-proofs" } filecoin-hashers = { version = "~1.1", default-features = false, features = ["poseidon", "sha256"], path = "../../../../rust-fil-proofs/filecoin-hashers" } fr32 = { version = "~0.2", default-features = false, path = "../../../../rust-fil-proofs/fr32" } storage-proofs-core = { version = "~6.1", default-features = false, path = "../../../../rust-fil-proofs/storage-proofs-core" } ``` ### 修改 Makefile ``` #git submodule update --init --recursive #@[[ "$$(awk '/const Version/{print $$5}' extern/filecoin-ffi/version.go)" -eq 3 ]] || (echo "FFI version mismatch, update submodules"; exit 1) ``` ### rust-fil-proofs ``` git clone https://gitee.com/olier/rust-fil-proofs.git cd rust-fil-proofs git checkout z-6.1.0 ``` ### bellperson ``` git clone https://gitee.com/olier/bellperson.git cd bellperson checkout z-0.13.0-3080 ``` ### 修改文件,旧版bellperson没有下面几个方法 ``` sed -i 's/ffi /\/\/ ffi /g' extern/sector-storage/ffiwrapper/prover_cgo.go sed -i 's/return ffi.AggregateSealProofs(aggregateInfo, proofs)/return nil, nil/g' extern/sector-storage/ffiwrapper/prover_cgo.go sed -i 's/return ffi.VerifyAggregateSeals(aggregate)/return true, nil/g' extern/sector-storage/ffiwrapper/verifier_cgo.go ``` ### 编译 ``` cd lotus make clean all lotus-bench ``` ### 测试 ``` ./lotus-bench sealing ```