Coder Social home page Coder Social logo

isabella232 / cpp-filecoin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filecoin-project/cpp-filecoin

0.0 0.0 0.0 14.41 MB

C++17 implementation of Filecoin

Home Page: https://filecoin.io/

License: GNU General Public License v3.0

CMake 2.71% C++ 96.27% Shell 0.12% Python 0.03% Go 0.80% C 0.02% Dockerfile 0.05%

cpp-filecoin's Introduction

Filecoin (cpp-filecoin)

C++17 implementation of blockchain based digital storage

Filecoin is a decentralized protocol described in spec

Minimal hardware requirements

Node minimal parameters:

Hard disk space: at least 200 GB
RAM: 8 GB
OS: Linux(Ubuntu), macOS. Other operating systems builds are not supported yet, so running on them may be unstable.

Miner minimal parameters:

CPU: 8+ cores
Hard Disk space: 256 GiB of very fast NVMe SSD memory space + 1 TiB of slow HDD memory space
RAM: 16 GB
GPU: GPU is highly recommended, it will speed up computations, but Mixing AMD CPUs and Nvidia GPUs should be avoided.

You can also read about lotus minimal requirements in filecoin-docs

Dependencies

All C++ dependencies are managed using Hunter. It uses cmake to download required libraries and do not require downloading and installing packages manually.

Target C++ compilers are:

  • GCC 9.3.0
  • Clang 9.0.1
  • AppleClang 12.0.0

Lotus CLI

fuhon-node supports subset of lotus CLI commands.
You may download pre-built binaries or build lotus from source.
Lotus CLI introduction.

Rust

filecoin-ffi provides pre-built binaries for some platforms.
If they are unavailable, you need Rust compiler to build them.
Rust installation instruction.

Build

# clone project
git clone --recursive https://github.com/filecoin-project/cpp-filecoin
# configure cmake
cmake cpp-filecoin -B cpp-filecoin/build
# build and install fuhon-node and fuhon-miner
cmake --build cpp-filecoin/build --target install
# check that fuhon-node and fuhon-miner are now available
fuhon-node --help
fuhon-miner --help

Usage

Interopnet node

Create the following fuhon-interopnet/config.cfg file

# use interopnet profile, corresponds to "make interopnet" lotus target
profile=interopnet

# enable debug logs to see sync progress
log=d

# bootstrap peers from https://github.com/filecoin-project/lotus/blob/master/build/bootstrap/interopnet.pi
bootstrap=/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWLGPq9JL1xwL6gHok7HSNxtK1Q5kyfg4Hk69ifRPghn4i
bootstrap=/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWFYS1f31zafv8mqqYu8U3hEqYvaZ6avWzYU3BmZdpyH3h

Start node

fuhon-node --repo fuhon-interopnet --genesis docker/interopnet/genesis.car
# you can omit --genesis flag after first run
fuhon-node --repo fuhon-interopnet

To use lotus CLI add --repo flag

lotus --repo fuhon-interopnet net peers

Mainnet node (from snapshot)

Download mainnet snapshot (docs).

LATEST_SNAPSHOT=$(curl -sI https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car | perl -ne '/x-amz-website-redirect-location:\s(.+\.car)/ && print $1')
curl -o mainnet-snapshot.car $LATEST_SNAPSHOT

Create following fuhon-mainnet/config.cfg file

# use downloaded snapshot file (do not delete that file)
use-snapshot=mainnet-snapshot.car

# bootstrap peers from https://github.com/filecoin-project/lotus/blob/master/build/bootstrap/mainnet.pi
bootstrap=/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt

Start node (first run may take some time)

fuhon-node --repo fuhon-mainnet --genesis cpp-filecoin/core/docker/mainnet/genesis.car

Docker-compose example

docker-compose up

CodeStyle

We follow CppCoreGuidelines.

Please use clang-format 11.0.0 with provided .clang-format file to autoformat the code.

Maintenance

Maintainers: @zuiris, @turuslan, @Elestrias, @ortyomka, @wer1st, @Alexey-N-Chernyshov

Tickets: Can be opened in GitHub Issues.

Hunter cache upload

If you have access and want to upload to hunter-binary-cache, you need to add your GitHub token with read:packages and write:packages permissions.
To generate GitHub token follow the instructions.

export GITHUB_HUNTER_USERNAME=<github account name>
export GITHUB_HUNTER_TOKEN=<github token>

cpp-filecoin's People

Contributors

ahmedelkashev avatar alexey-n-chernyshov avatar art-gor avatar deni64k avatar eigendude avatar ekovalev avatar elestrias avatar harrm avatar igkrsh avatar igor-egorov avatar kamilsa avatar markuu-s avatar masterjedy avatar mingela avatar ortyomka avatar sergkaprovich avatar turuslan avatar warchant avatar zuiris avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.