IPFS / Filecoin compilation

IPFS

go-IPFS compiled in the windows to follow the instructions available here: https: //github.com/ipfs/go-ipfs/blob/master/docs/windows.md#minimal

I chose MSYS

However, we encountered the following problems: 

16385914-5b856147617a979d.jpg

The following error message:

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

solution

在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

The following information is successful

16385914-5a22b77c475c2948.jpg

Check that ipfs.exe has been generated. To the% GOPATH% / bin:

16385914-0cefca894d315c52.jpg

Hello!!!!

In addition, living in mainland China, if not in the download package golang.org/x/, please set GOPROXY environment variable.

16385914-401e01702fd9a149.jpg

Go prerequisite version 1.11 or more.

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


Successful, ha ha

16385914-8349462decf79217.jpg

Look at the current status of synchronized

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


16385914-515968a0661ca18b.png

Reproduced in: https: //www.jianshu.com/p/1fdbd7a9bad3

Guess you like

Origin blog.csdn.net/weixin_34357962/article/details/91078232