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)
有疑问加站长微信联系(非本文作者)