IPFS/Filecoin的编译

IPFS

go-IPFS在windows下的编译要遵从这里的指令:https://github.com/ipfs/go-ipfs/blob/master/docs/windows.md#minimal

我选择MSYS

但是,遇到如下的问题: 

错误信息如下:

plugin\loader\preload.go:12:2: undefined: pluginipldgit

plugin\loader\preload.go:13:2: undefined: pluginbadgerds

plugin\loader\preload.go:14:2: undefined: pluginflatfs

plugin\loader\preload.go:15:2: undefined: pluginlevelds

解决方案

在E:\Gowork\src\github.com\ipfs\go-ipfs\plugin\loader\preload.sh里

cat<<EOL

package loader

import (

"github.com/ipfs/go-ipfs/plugin" pluginipldgit "github.com/ipfs/go-ipfs/plugin/plugins/git" pluginbadgerds "github.com/ipfs/go-ipfs/plugin/plugins/git" pluginflatfs "github.com/ipfs/go-ipfs/plugin/plugins/git" pluginlevelds "github.com/ipfs/go-ipfs/plugin/plugins/git"EOL

to_preload | while read -r name path num; do

下面是成功信息

检查ipfs.exe是否已经生成。到%GOPATH%/bin下:

Hola!!!!

另外,身处中国大陆,如果下载不了golang.org/x/下的package的话,请设置GOPROXY环境变量。

前提条件是Go的版本在1.11以上。

Filecoin

https://github.com/filecoin-project/go-filecoin/issues/2503

Error

gorun ./build build

command from root I've faced on this error

Building go-filecoin...

git log -n 1 --format=%H

go build -ldflags -X github.com/filecoin-project/go-filecoin/flags.Commit=1cdea1b6b8a17ea38cac0074241d1b3b9945e102 -v -o go-filecoin .

github.com/filecoin-project/go-filecoin/proofs# github.com/filecoin-project/go-filecoin/proofsproofs/rustverifier.go:66:3: cannot use _cgo4 (type *[31]_Ctype_uchar) as type unsafe.Pointer in argument to _Cfunc_verify_seal

proofs/rustverifier.go:66:3: cannot use _cgo5 (type *[31]_Ctype_uchar) as type unsafe.Pointer in argument to _Cfunc_verify_seal

Command 'go build -ldflags -X github.com/filecoin-project/go-filecoin/flags.Commit=1cdea1b6b8a17ea38cac0074241d1b3b9945e102 -v -o go-filecoin .' fail

Solution 

Due to our use ofcgo, you'll need a C compiler to build go-filecoin whether you're using a prebuilt libfilecoin_proofs (our cgo-compatible rust-fil-proofs library) or building it yourself from source. If you want to usegcc(e.g.export CC=gcc) when building go-filecoin, you will need to use v7.4.0 or higher.

You can resolve this issue by either:

Installing clang and setting the CCenvironment variable toclang, e.g.export CC=clang

Upgrading gcc to a supported version


成功了,哈哈

查看一下当前同步的状况

./go-filecoin show block $(./go-filecoin chain head)

同步了将近一周,终于完成了: 

钱包里的测试用币 

Message(对应以太坊里的Transaction)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • # Awesome Python [![Awesome](https://cdn.rawgit.com/sindr...
    emily_007阅读 2,343评论 0 3
  • 那些遗忘的、枯萎的、被扼杀的、被摧残的爱好与梦想,都是空盆。 气象意义的夏天已经过去,酷暑带来的伤害接踵而来。...
    风信子也阅读 745评论 9 5
  • 文/峰霞仙子 医生开出了一系列的检查单,为这百十斤的骨肉,寻找因岁月辗转剥蚀,已初心不同的痛点。 一如这个季节,是...
    峰霞仙子阅读 444评论 2 21

友情链接更多精彩内容