forest_actor
cargo install forest_actor

forest_actor

🌲 Rust Filecoin Node Implementation

by ChainSafe

0.1.0 (see all)License:MIT OR Apache-2.0
cargo install forest_actor
Readme

build status GitHub release (latest by date) Apache License MIT License Twitter Discord

Forest is an implementation of Filecoin written in Rust. The implementation will take a modular approach to building a full Filecoin node in Rust from the Filecoin Protocol Specification, specifically the virtual machine, blockchain, and node system.

Our crates:

componentdescription/crates
forestthe command-line interface and daemon (1 crate/workspace)
nodethe networking stack and storage (7 crates)
blockchainthe chain structure and synchronization (6 crates)
vmstate transition and actors, messages, addresses (9 crates)
key_managementFilecoin account management (1 crate)
cryptocryptographic functions, signatures, and verification (1 crate)
encodingserialization library for encoding and decoding (1 crate)
ipldthe IPLD model for content-addressable data (9 crates)
typesthe forest types (2 crates)
utilsthe forest toolbox (12 crates)

Dependencies

rustc >= 1.55.0

Usage

# Clone repository
git clone --recursive https://github.com/chainsafe/forest
cd forest

# Install binary to $HOME/.cargo/bin and run node
make install
forest

To create release binaries, checkout the latest tag and compile with the release feature. GitHub release (latest by date)

git checkout $TAG
cargo build --release --bin forest --features release

OpenCL, hwloc and a compatible assembly linker (ex. clang) are also required to build Filecoin proofs.

Config

Run the node with custom config and bootnodes

forest --config /path/to/your_config.toml

Example of config options available:

data_dir = "<directory for all chain and networking data>"
genesis_file = "<relative file path of genesis car file>"

[network]
listening_multiaddr = "<multiaddress>"
bootstrap_peers = ["<multiaddress>"]

Example of a multiaddress: "/ip4/54.186.82.90/tcp/1347/p2p/12D3K1oWKNF7vNFEhnvB45E9mw2B5z6t419W3ziZPLdUDVnLLKGs"

Logging

The Forest logger uses Rust's log filtering options with the RUST_LOG environment variable. For example:

RUST_LOG="debug,forest_libp2p::service=info" forest

Will show all debug logs by default, but the forest_libp2p::service logs will be limited to info

Testing

# To run base tests
cargo test # use `make test-release` for longer compilation but faster execution

# To pull serialization vectors submodule and run serialization and conformance tests
make test-vectors

# To run all tests and all features enabled
make test-all

Joining the testnet

Build with the interopnet config with:

make interopnet

# Run and import past the state migrations to latest network version
./target/release/forest --import-snapshot ./types/networks/src/interopnet/snapshot.car

Importing the snapshot only needs to happen during the first run. Following this, to restart the daemon run:

./target/release/forest

Interacting with Forest via CLI

When the Forest daemon is started, an admin token will be displayed. You will need this for commands that require a higher level of authorization (like a password). Forest, as mentioned above, uses multiaddresses for networking. This is no different in the CLI. To set the host and the port to use, if not using the default port or using a remote host, set the FULLNODE_API_INFO environment variable. This is also where you can set a token for authentication.

FULLNODE_API_INFO="<token goes here>:/ip4/<host>/tcp/<port>/http

Note that if a token is not present in the FULLNODE_API_INFO env variable, the colon is removed.

Forest developers will prepend this variable to CLI commands over using export on Linux or its equivalant on Windows. This will look like the following:

FULLNODE_API_INFO="..." forest auth api-info -p admin

Documentation

Work in progress.

Contributing

ChainSafe Security Policy

Reporting a Security Bug

We take all security issues seriously, if you believe you have found a security issue within a ChainSafe project please notify us immediately. If an issue is confirmed, we will take all necessary precautions to ensure a statement and patch release is made in a timely manner.

Please email a description of the flaw and any related information (e.g. reproduction steps, version) to security at chainsafe dot io.

License

Forest is dual licensed under MIT + Apache 2.0.

GitHub Stars

355

LAST COMMIT

8mos ago

MAINTAINERS

1

CONTRIBUTORS

32

OPEN ISSUES

76

OPEN PRs

7
VersionTagPublished
0.1.0
2yrs ago
No alternatives found
No tutorials found
Add a tutorial