{"id":13511279,"url":"https://github.com/ChainSafe/forest","last_synced_at":"2025-03-30T20:32:48.653Z","repository":{"id":37207110,"uuid":"221071442","full_name":"ChainSafe/forest","owner":"ChainSafe","description":"🌲 Rust Filecoin Node Implementation","archived":false,"fork":false,"pushed_at":"2025-03-30T00:24:28.000Z","size":28910,"stargazers_count":648,"open_issues_count":153,"forks_count":162,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-03-30T13:11:25.703Z","etag":null,"topics":["blockchain","filecoin","p2p","rust"],"latest_commit_sha":null,"homepage":"https://forest.chainsafe.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChainSafe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-11T21:15:40.000Z","updated_at":"2025-03-28T00:58:35.000Z","dependencies_parsed_at":"2024-01-02T01:12:12.797Z","dependency_job_id":"68a62327-cf37-4177-8cbc-de04736d7fc4","html_url":"https://github.com/ChainSafe/forest","commit_stats":{"total_commits":2884,"total_committers":58,"mean_commits":"49.724137931034484","dds":0.8099861303744799,"last_synced_commit":"404b835328602e5e77bda85e42a402e290c457d7"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fforest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fforest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fforest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fforest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/forest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379366,"owners_count":20767694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","filecoin","p2p","rust"],"created_at":"2024-08-01T03:00:46.112Z","updated_at":"2025-03-30T20:32:48.645Z","avatar_url":"https://github.com/ChainSafe.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg height=\"243\" src=\"documentation/src/img/forest_logo.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ChainSafe/forest/actions\"\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/ChainSafe/forest/forest.yml?style=for-the-badge\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ChainSafe/forest/releases/latest\"\u003e\u003cimg alt=\"Latest release\" src=\"https://img.shields.io/github/v/release/ChainSafe/forest?style=for-the-badge\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.forest.chainsafe.io\"\u003e\u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/doc-user_guide-green?style=for-the-badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ChainSafe/forest/blob/main/LICENSE-APACHE\"\u003e\u003cimg alt=\"License Apache 2.0\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ChainSafe/forest/blob/main/LICENSE-MIT\"\u003e\u003cimg alt=\"License MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/ChainSafeth\"\u003e\u003cimg alt=\"Twitter\" src=\"https://img.shields.io/twitter/follow/chainsafeth?style=for-the-badge\u0026color=1DA1F2\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nForest is a [Filecoin] node written in [Rust]. With Forest, you can:\n\n- Send and receive FIL (at your own risk - Forest is experimental),\n- validate the Filecoin blockchain,\n- generate blockchain snapshots.\n\nWhile less feature-complete than the canonical Filecoin node, [Lotus], Forest\naims to be the faster and easier-to-use alternative.\n\n## Questions\n\nHave questions? Feel free to post them in [Forest Q\u0026A]!\n\n## Run with Docker\n\nNo need to install Rust toolchain or other dependencies, you will need only\nDocker - works on Linux, macOS and Windows.\n\n```\n# daemon\n❯ docker run --init -it --rm ghcr.io/chainsafe/forest:latest --help\n# cli\n❯ docker run --init -it --rm --entrypoint forest-cli ghcr.io/chainsafe/forest:latest --help\n```\n\nNext, run a Forest node in a CLI window. E.g.\n[Run calibration network](https://docs.forest.chainsafe.io/getting_started/syncing/#calibnet)\n\nThereafter, in another terminal, you will be able to use the `forest-cli` binary\ndirectly by launching `bash` in the `forest` container:\n\n```\ndocker exec -it forest /bin/bash\n```\n\nFor more in-depth usage and sample use cases, please refer to the Forest Docker\ndocumentation in the [Forest Book]. Keep in mind that the `latest` tag is the latest\nstable release. If you want to use the current development build, use the `edge`\ntag.\n\n## Dependencies\n\n- Rust (toolchain version is specified in `rust-toolchain.toml`)\n- Go for building F3 sidecar module. (toolchain version is specified in\n  `go.work`)\n\nInstall [rustup](https://rustup.rs/)\n\nInstall [Go](https://go.dev/doc/install)\n\n- OS Base-Devel/Build-Essential\n- Clang compiler\n\n### Ubuntu (20.04)\n\n```\nsudo apt install build-essential clang\n```\n\n### Archlinux\n\n```\nsudo pacman -S base-devel clang\n```\n\n### Fedora (36)\n\n```\nsudo dnf install -y clang-devel\n```\n\n### Alpine\n\n```\napk add git curl make gcc clang clang-dev musl-dev\n```\n\n## Installation\n\n```shell\n# Clone repository\ngit clone --recursive https://github.com/chainsafe/forest\ncd forest\n\n# Install binary to $HOME/.cargo/bin\nmake install\n\n# Run the node on mainnet\nforest\n```\n\nTo create release binaries, checkout the latest tag and compile with the release\nfeature.\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/ChainSafe/forest?style=for-the-badge)](https://github.com/ChainSafe/forest/releases/latest)\n\n```shell\ngit checkout $TAG\nmake build # make debug build of forest daemon and cli\n# or\nmake release # make release build of forest daemon and cli\n# or\nmake install # install forest daemon and cli\n```\n\n### Config\n\n#### Keystore\n\nTo encrypt the keystore while in headless mode, set the `FOREST_KEYSTORE_PHRASE`\nenvironmental variable. Otherwise, skip the encryption (not recommended in\nproduction environments) with `--encrypt-keystore false`.\n\n#### Network\n\nRun the node with custom config and bootnodes\n\n```bash\nforest --config /path/to/your_config.toml\n```\n\nExample of config options available:\n\n```toml\n[client]\ndata_dir = \"\u003cdirectory for all chain and networking data\u003e\"\ngenesis_file = \"\u003crelative file path of genesis car file\u003e\"\n\n[network]\nlistening_multiaddrs = [\"\u003cmultiaddress\u003e\"]\nbootstrap_peers = [\"\u003cmultiaddress\u003e\"]\n```\n\nExample of a [multiaddress](https://github.com/multiformats/multiaddr):\n`\"/ip4/54.186.82.90/tcp/1347/p2p/12D3K1oWKNF7vNFEhnvB45E9mw2B5z6t419W3ziZPLdUDVnLLKGs\"`\n\n#### Configuration sources\n\nForest will look for config files in the following order and priority:\n\n- Paths passed to the command line via the `--config` flag.\n- The environment variable `FOREST_CONFIG_PATH`, if no config was passed through\n  command line arguments.\n- If none of the above are found, Forest will look in the systems default\n  configuration directory (`$XDG_CONFIG_HOME` on Linux systems).\n- After all locations are exhausted and a config file is not found, a default\n  configuration is assumed and used.\n\n### Logging\n\nThe Forest logger uses\n[Rust's log filtering options](https://doc.rust-lang.org/1.1.0/log/index.html#filtering-results)\nwith the `RUST_LOG` environment variable. For example:\n\n```bash\nRUST_LOG=\"debug,forest_libp2p::service=info\" forest\n```\n\nWill show all debug logs by default, but the `forest_libp2p::service` logs will\nbe limited to `info`\n\nForest can also send telemetry to the endpoint of a Loki instance or a Loki\nagent (see [Grafana Cloud](https://grafana.com/oss/loki/)). Use `--loki` to\nenable it and `--loki-endpoint` to specify the interface and the port.\n\n### Testing\n\nFirst, install the [`nextest`](https://nexte.st/) test runner.\n\n```bash\ncargo install cargo-nextest --locked\n```\n\n```bash\n# To run base tests\ncargo nextest run # use `make test-release` for longer compilation but faster execution\n\n# To run all tests and all features enabled\nmake test-all\n```\n\nChain synchronization checks are run after every merge to `main`. This code is\nmaintained in a separate repository - [Forest IaC].\n\n### Linters\n\nThe project uses exhaustively a set of linters to keep the codebase clean and\nsecure in an automated fashion. While the CI will have them installed, if you\nwant to run them yourself before submitting a PR (recommended), you should\ninstall a few of them.\n\n```bash\n# You can install those linters also with other package managers or by manually grabbing the binaries from the projects' repositories.\n\n# Rust code linter\nrustup component add clippy\n\n# Rust code formatter\nrustup component add rustfmt\n\n# TOML linter\ncargo install taplo-cli --locked\n\n# Scanning dependencies for security vulnerabilities\ncargo install cargo-audit\n\n# Spellcheck\ncargo install cargo-spellcheck\n```\n\nAfter everything is installed, you can run `make lint-all`.\n\n### Joining the testnet\n\nSelect the builtin calibnet configuration with the `--chain` option. The\n`--auto-download-snapshot` will ensure that a snapshot is downloaded if needed\nwithout any prompts.\n\n```bash\n./target/release/forest --chain calibnet --auto-download-snapshot\n```\n\n### Interacting with Forest via CLI\n\nWhen the Forest daemon is started, an admin token will be displayed\n(alternatively, use `--save-token \u003ctoken\u003e` flag to save it on disk). You will\nneed this for commands that require a higher level of authorization (like a\npassword). Forest, as mentioned above, uses multiaddresses for networking. This\nis no different in the CLI. To set the host and the port to use, if not using\nthe default port or using a remote host, set the `FULLNODE_API_INFO` environment\nvariable. This is also where you can set a token for authentication.\n\n```\nFULLNODE_API_INFO=\"\u003ctoken goes here\u003e:/ip4/\u003chost\u003e/tcp/\u003cport\u003e/http\n```\n\nNote that if a token is not present in the FULLNODE_API_INFO env variable, the\ncolon is removed.\n\nForest developers will prepend this variable to CLI commands over using `export`\non Linux or its equivalent on Windows. This will look like the following:\n\n```\nFULLNODE_API_INFO=\"...\" forest-cli auth api-info -p admin\n```\n\nThe admin token can also be set using `--token` flag.\n\n```\nforest-cli --token \u003cADMIN_TOKEN\u003e\n```\n\n### Forest executable organization\n\nThe binaries in the Forest repository are organized into the following\ncategories:\n\n| Binary        | Role                                                     | Command example                                    |\n| ------------- | -------------------------------------------------------- | -------------------------------------------------- |\n| `forest`      | Forest daemon, used to connect to the Filecoin network   | `forest --chain calibnet --encrypt-keystore false` |\n| `forest-cli`  | Human-friendly wrappers around the Filecoin JSON-RPC API | `forest-cli info show`                             |\n| `forest-tool` | Handle tasks not involving the Forest daemon             | `forest-tool snapshot fetch`                       |\n\n### Detaching Forest process\n\nYou can detach Forest process via the `--detach` flag so that it runs in the\nbackground:\n\n```bash\n./target/release/forest --detach\n```\n\nThe command will block until the detached Forest process has started its RPC\nserver, allowing you to chain some RPC command immediately after.\n\n### Forest snapshot links\n\n- [calibration network](https://forest-archive.chainsafe.dev/latest/calibnet/)\n- [main network](https://forest-archive.chainsafe.dev/latest/mainnet/)\n\n### Documentation\n\n- [Forest Book](https://docs.forest.chainsafe.io/)\n\n## Contributing\n\n- Check out our contribution guidelines: [CONTRIBUTING.md]\n\n## ChainSafe Security Policy\n\n### Reporting a Security Bug\n\nWe take all security issues seriously, if you believe you have found a security\nissue within a ChainSafe project please notify us immediately. If an issue is\nconfirmed, we will take all necessary precautions to ensure a statement and\npatch release is made in a timely manner.\n\nPlease email a description of the flaw and any related information (e.g.\nreproduction steps, version) to [security at chainsafe dot io].\n\n## License\n\nForest is dual licensed under [MIT] + [Apache 2.0].\n\n[Filecoin]: https://filecoin.io/\n[Rust]: https://www.rust-lang.org/\n[Lotus]: https://lotus.filecoin.io/\n[Forest Book]: https://docs.forest.chainsafe.io/\n[Forest Q\u0026A]: https://github.com/ChainSafe/forest/discussions/categories/forest-q-a\n[CONTRIBUTING.md]: documentation/src/developer_documentation/contributing.md\n[Forest IaC]: https://github.com/ChainSafe/forest-iac\n[security at chainsafe dot io]: mailto:security@chainsafe.io\n[MIT]: https://github.com/ChainSafe/forest/blob/main/LICENSE-MIT\n[Apache 2.0]: https://github.com/ChainSafe/forest/blob/main/LICENSE-APACHE\n","funding_links":[],"categories":["Blockchains","Rust","Applications","应用程序 Applications","Networks / Blockchains","Uncategorized"],"sub_categories":["Blockchain","加密货币 Cryptocurrencies","Cryptocurrencies","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fforest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChainSafe%2Fforest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fforest/lists"}