Filecoin 编译问题

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

 

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

Error

go run ./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/proofs
proofs/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 of cgo, 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 use gcc (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:

  1. Installing clang and setting the CC environment variable to clang, e.g. export CC=clang
  2. Upgrading gcc to a supported version

 

成功了,哈哈

Filecoin 编译问题_第1张图片

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

8c75a99780cfe9b10f0bf2059c11bc942b4.jpg

root@btcpool:/work/gowork/src/github.com/filecoin-project/go-filecoin# ./go-filecoin show block $(./go-filecoin chain head)
Block Details
Miner:  t27gvotilvoudxezxxu2atwfc42otsprm6wvt5x6i
Weight: 2567854.534
Height: 372740
Nonce:  0

钱包里的测试用币 

7ca944cc43da5875570b1e5c4cc6dcaad35.jpg

Message(对应以太坊里的Transaction)

Filecoin 编译问题_第2张图片

root@btcpool:/work/gowork/src/github.com/filecoin-project/go-filecoin# ./go-filecoin message wait zDPWYqFCufco1gAxo1o7zJQivy5mX4yZ62a3ZXkEFZhiQ4djs5dG
{
        "meteredMessage": {
                "message": {
                        "to": "t1yyrs2zdjs3fyzdfctrjxk4ero4orzhlnkcpeloa",
                        "from": "t1f66uecq4mekanhhne5nsehckqerfrhxbwxnufia",
                        "nonce": "12902",
                        "value": "1000",
                        "method": "",
                        "params": null
                },
                "gasPrice": "1",
                "gasLimit": "0"
        },
        "signature": "SfvwHxX46uh8oS491iGwbBwJMq2683XD1R5ErtAGKOkYXO4k4IbNjYn7xn0MuAtDsdI3RP7OnTmQ4XmdnOf+ogA="
}
{
        "exitCode": 0,
        "return": null,
        "gasAttoFIL": "0"
}

备忘:

root@btcpool:/work/gowork/src/github.com/filecoin-project/go-filecoin# git branch -l
* (HEAD detached at 0.2.2)

 

转载于:https://my.oschina.net/gavinzheng731/blog/3041174

你可能感兴趣的:(Filecoin 编译问题)