Skip to content
Filecoin Full Node Implementation in Go
Branch: master
Clone or download
shannonwells move net/testing to testhelpers/net (#2399)
* move net/testing to testhelpers/net
Latest commit 75d4548 Mar 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github/ISSUE_TEMPLATE
abi integrate go-filecoin with real PoSt generation and verification rout… Mar 18, 2019
actor move net/testing to testhelpers/net (#2399) Mar 23, 2019
address
bin
bls-signatures Fix go-filecoin on go 1.12.1 (#2308) Mar 18, 2019
build add metrics config and opencensus metrics closes #2257 Mar 22, 2019
cborutil
chain move net/testing to testhelpers/net (#2399) Mar 23, 2019
commands move net/testing to testhelpers/net (#2399) Mar 23, 2019
config add metrics config and opencensus metrics closes #2257 Mar 22, 2019
consensus move net/testing to testhelpers/net (#2399) Mar 23, 2019
core move chain/testing to testhelpers package (#2391) Mar 22, 2019
crypto Fix fix of transient test failure (#2242) Mar 11, 2019
exec PoSt generation and verification should use same challenge seed (#2205) Mar 12, 2019
fixtures
flags feat: implement basic daemon and version commands Feb 1, 2018
functional-tests Bugs/2315-and-2348 fix retrieval script + remove fmt.Printf (#2358) Mar 20, 2019
gengen Feat/address plum pork 1869 (#2280) Mar 15, 2019
metrics
mining move net/testing to testhelpers/net (#2399) Mar 23, 2019
net move net/testing to testhelpers/net (#2399) Mar 23, 2019
node move chain/testing to testhelpers package (#2391) Mar 22, 2019
plumbing move net/testing to testhelpers/net (#2399) Mar 23, 2019
porcelain Provide porcelain and cli command to retrieve default wallet address (#… Mar 19, 2019
proofs
protocol check commit for test devnet (#2395) Mar 22, 2019
repo
sampling PoSt generation and verification should use same challenge seed (#2205) Mar 12, 2019
scripts require rustup when building local rust dependencies (#2369) Mar 21, 2019
state Moved Client ListAsks from node api to porcelain (#2300) Mar 18, 2019
testhelpers move net/testing to testhelpers/net (#2399) Mar 23, 2019
tools localnet: Binary flag and README (#2367) Mar 21, 2019
types
util Fix go-filecoin on go 1.12.1 (#2308) Mar 18, 2019
vm update calling code and fix tests Mar 14, 2019
wallet Feat/address plum pork 1869 (#2280) Mar 15, 2019
.gitignore remove duplicate .gitignore entry Feb 21, 2019
.gitmodules chore: rename rust-proofs to rust-fil-proofs Feb 22, 2019
CODEWALK.md Update TOC in CODEWALK.md (#2286) Mar 17, 2019
CODE_OF_CONDUCT.md docs(code-of-conduct): update filename to match githubs naming conven… Mar 12, 2018
CONTRIBUTING.md add integration to contrib (#2140) Mar 6, 2019
COPYRIGHT Add files via upload Dec 5, 2018
Dockerfile Update Dockerfiles to use go 1.12.1 (#2323) Mar 18, 2019
Dockerfile.ci.base adds a stripped down base Dockerfile for CI Feb 22, 2019
Dockerfile.ci.faucet
Dockerfile.ci.filecoin
Dockerfile.ci.genesis
Dockerfile.faucet
Dockerfile.genesis Update Dockerfiles to use go 1.12.1 (#2323) Mar 18, 2019
KNOWN_ISSUES.md
LICENSE-APACHE Update to dual MIT/Apache-2 license (#918) Sep 19, 2018
LICENSE-MIT Update to dual MIT/Apache-2 license (#918) Sep 19, 2018
Makefile add docker attrs Sep 11, 2018
README.md
appveyor.yml
designdocs.md update contributing guide (#1361) Nov 26, 2018
issue_template.md
main.go
networking.md Update networking.md (#2334) Mar 20, 2019
package.json
xargs Feat/swarm plum pork (#2343) Mar 20, 2019

README.md

Filecoin (go-filecoin)

CircleCI User Devnet Release Nightly Devnet Release Test Devnet Release

Filecoin implementation in Go, turning the world’s unused storage into an algorithmic market.

Table of Contents

What is Filecoin?

Filecoin is a decentralized storage network that turns the world’s unused storage into an algorithmic market, creating a permanent, decentralized future for the web. Miners earn the native protocol token (also called “filecoin”) by providing data storage and/or retrieval. Clients pay miners to store or distribute data and to retrieve it. Check out How Filecoin Works for more.

WARNING: go-filecoin is a work in progress and is not ready for production use. See KNOWN_ISSUES for an outline of known vulnerabilities.

Install

👋 Welcome to Go Filecoin!

System Requirements

Filecoin can build and run on most Linux and MacOS systems with at least 8GB of RAM. Windows is not yet supported.

Install from Source

Clone the git repository:

mkdir -p ${GOPATH}/src/github.com/filecoin-project
git clone https://github.com/filecoin-project/go-filecoin.git ${GOPATH}/src/github.com/filecoin-project/go-filecoin

Now install the tools and dependencies listed below. If you have any problems building go-filecoin, see the Troubleshooting & FAQ Wiki page.

Install Go and Rust

The build process for go-filecoin requires:

  • Go >= v1.12.1
    • Installing Go for the first time? We recommend this tutorial which includes environment setup.
  • Rust >= v1.31.0 and cargo
  • pkg-config - used by go-filecoin to handle generating linker flags
    • Mac OS devs can install through brew brew install pkg-config

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 must have libclang on you linker search path in order to build rust-fil-proofs from source. You can satisfy this requirement in most environments by installing Clang using your favorite package manager.

Install Dependencies

go-filecoin depends on some proofs code written in Rust, housed in the rust-fil-proofs repo and consumed as a submodule. You will need to have cargo and jq installed.

go-filecoin's dependencies are managed by gx; this project is not "go gettable." To install gx, gometalinter, and other build and test dependencies (with precompiled proofs, recommended), run:

cd ${GOPATH}/src/github.com/filecoin-project/go-filecoin
FILECOIN_USE_PRECOMPILED_RUST_PROOFS=true go run ./build/*.go deps

Note: The first time you run deps can be slow as a ~1.6GB parameter file is either downloaded or generated locally in /tmp/filecoin-proof-parameters. Have patience; future runs will be faster.

Build, Run Tests, and Install

# First, build the binary
go run ./build/*.go build

# Install go-filecoin to ${GOPATH}/bin (necessary for tests)
go run ./build/*.go install

# Then, run the tests.
go run ./build/*.go test

# Build and test can be combined!
go run ./build/*.go best

Other handy build commands include:

# Check the code for style and correctness issues
go run ./build/*.go lint

# Test with a coverage report
go run ./build/*.go test -cover

# Test with Go's race-condition instrumentation and warnings (see https://blog.golang.org/race-detector)
go run ./build/*.go test -race

# Deps, Lint, Build, Test (any args will be passed to `test`)
go run ./build/*.go all

Note: Any flag passed to go run ./build/*.go test (e.g. -cover) will be passed on to go test.

If you have problems with the build, please see the Troubleshooting & FAQ Wiki page.

Manage Submodules Manually (optional)

If you're editing rust-fil-proofs, you need to manage the submodule manually. If you're not editing rust-fil-proofs you can relax: deps build (above) will do it for you. You may need to run deps again after pulling master if the submodule is updated by someone else (it will appear modified in git status).

To initialize the submodule:

cd ${GOPATH}/src/github.com/filecoin-project/go-filecoin
git submodule update --init

Later, when the head of the rust-fil-proofs master branch changes, you may want to update go-filecoin to use these changes:

git submodule update --remote

Note that updating the rust-fil-proofs submodule in this way will require a commit to go-filecoin (changing the submodule hash).

Usage

The Getting Started wiki page contains a simple sequence to get your Filecoin node up and running and connected to a devnet.

The Commands page contains further detail about specific commands and environment variables, as well as scripts for for setting up a miner and making a deal.

To see a full list of commands, run go-filecoin --help.

Advanced usage

Run Multiple Nodes with IPTB

The localfilecoin IPTB plugin provides an automation layer that makes it easy to run multiple filecoin nodes. For example, it enables you to easily start up 10 mining nodes locally on your machine.

Contributing

We ❤️ all our contributors; this project wouldn’t be what it is without you! If you want to help out, please see CONTRIBUTING.md.

Check out the Go-Filecoin code overview for a brief tour of the code.

Community

Here are a few places to get help and connect with the Filecoin community:

Looking for even more? See the full rundown at filecoin-project/community.

Developer Networks

There are currently 3 developer networks (aka devnets) available for development and testing. These are subject to frequent downtimes and breaking changes. See Devnets in the wiki for a description of these developer networks and instructions for connecting your nodes to them.

License

The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:

You can’t perform that action at this time.