php怎么修改成ipfs协议,IPFS/Filecoin的编译

IPFS

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

我选择MSYS

但是,遇到如下的问题:

46ef3593dcae2caadd08aa7f92ca4255.png

错误信息如下: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<

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

下面是成功信息

3b6fd79c3c789d162430e93376149624.png

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

4450d2e194bfe956134298d3b5afcb23.png

Hola!!!!

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

2637a5b6b974107f585ac3d045160aff.png

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

Filecoin

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

Errorgorun ./build build

command from root I've faced on this errorBuilding 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

成功了,哈哈

9d74a94bbf0049a39b997e2665d90b09.png

查看一下当前同步的状况./go-filecoin show block $(./go-filecoin chain head)

c9495d6efde396342b7f273fb095275c.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值