2019独角兽企业重金招聘Python工程师标准>>>
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 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 theCC
environment variable toclang
, e.g.export CC=clang
- Upgrading
gcc
to a supported version
成功了,哈哈
同步了将近一周,终于完成了:
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
钱包里的测试用币
Message(对应以太坊里的Transaction)
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)