1#![recursion_limit = "1024"]
5#![cfg_attr(
6 not(test),
7 deny(
8 clippy::todo,
9 clippy::dbg_macro,
10 clippy::indexing_slicing,
11 clippy::get_unwrap,
12 clippy::unwrap_used,
13 clippy::unreachable,
14 clippy::unimplemented
15 )
16)]
17#![cfg_attr(
18 doc,
19 deny(rustdoc::all),
20 allow(
21 rustdoc::private_intra_doc_links,
24 rustdoc::private_doc_tests,
26 rustdoc::missing_crate_level_docs
27 )
28)]
29
30const _: () = assert!(
33 usize::BITS == 64,
34 "Forest only supports 64-bit targets (requires usize == u64)"
35);
36
37cfg_if::cfg_if! {
38 if #[cfg(feature = "rustalloc")] {
39 } else if #[cfg(feature = "jemalloc")] {
40 use crate::cli_shared::tikv_jemallocator::Jemalloc;
41 #[global_allocator]
42 static GLOBAL: Jemalloc = Jemalloc;
43 } else if #[cfg(feature = "system-alloc")] {
44 use std::alloc::System;
45 #[global_allocator]
46 static GLOBAL: System = System;
47 }
48}
49
50mod auth;
51mod beacon;
52mod blocks;
53mod chain;
54mod chain_sync;
55mod cid_collections;
56mod cli;
57mod cli_shared;
58mod daemon;
59mod db;
60mod dev;
61mod documentation;
62mod eth;
63mod f3;
64mod fil_cns;
65mod genesis;
66mod health;
67mod interpreter;
68mod ipld;
69mod key_management;
70mod libp2p;
71mod libp2p_bitswap;
72mod lotus_json;
73mod message;
74mod message_pool;
75mod metrics;
76mod networks;
77mod rpc;
78mod shim;
79mod state_manager;
80mod state_migration;
81mod statediff;
82#[cfg(any(test, doc))]
83mod test_utils;
84mod tool;
85mod utils;
86mod wallet;
87
88mod prelude {
89 pub use crate::{
90 db::Blockstore,
91 shim::clock::ChainEpoch,
92 utils::{ShallowClone, get_size::CidWrapper},
93 };
94 pub use ahash::{HashMapExt as _, HashSetExt as _};
95 pub use anyhow::Context as _;
96 pub use cid::Cid;
97 pub use futures::FutureExt as _;
98 pub use itertools::Itertools as _;
99 pub use std::{ops::Deref as _, sync::Arc};
100 pub use tracing::{debug, error, info, trace, warn};
101}
102
103#[cfg(feature = "doctest-private")]
111#[doc(hidden)]
112pub mod doctest_private {
113 pub use crate::{
114 blocks::{CachingBlockHeader, Ticket, TipsetKey},
115 cli::humantoken::{TokenAmountPretty, parse},
116 shim::{
117 address::Address, crypto::Signature, econ::TokenAmount, error::ExitCode,
118 randomness::Randomness, sector::RegisteredSealProof, state_tree::ActorState,
119 version::NetworkVersion,
120 },
121 utils::io::progress_log::WithProgress,
122 utils::net::{DownloadFileOption, download_to},
123 utils::{encoding::blake2b_256, encoding::keccak_256, io::read_toml},
124 };
125}
126
127#[cfg(feature = "benchmark-private")]
130#[doc(hidden)]
131pub mod benchmark_private;
132
133#[cfg(feature = "interop-tests-private")]
136#[doc(hidden)]
137pub mod interop_tests_private {
138 pub mod libp2p {
139 pub use crate::libp2p::*;
140 }
141 pub mod libp2p_bitswap {
142 pub use crate::libp2p_bitswap::*;
143 }
144 pub mod beacon {
145 pub use crate::beacon::BeaconEntry;
146 }
147 pub mod multihash {
148 pub use crate::utils::multihash::MultihashCode;
149 }
150}
151
152pub use auth::{JWT_IDENTIFIER, verify_token};
154pub use cli::main::main as forest_main;
155pub use cli_shared::cli::{Client, Config};
156pub use daemon::main::main as forestd_main;
157pub use dev::main::main as forest_dev_main;
158pub use key_management::{
159 ENCRYPTED_KEYSTORE_NAME, FOREST_KEYSTORE_PHRASE_ENV, KEYSTORE_NAME, KeyStore, KeyStoreConfig,
160};
161pub use tool::main::main as forest_tool_main;
162pub use wallet::main::main as forest_wallet_main;