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 )
13)]
14#![cfg_attr(
15 doc,
16 deny(rustdoc::all),
17 allow(
18 rustdoc::private_intra_doc_links,
21 rustdoc::private_doc_tests,
23 rustdoc::missing_crate_level_docs
24 )
25)]
26
27cfg_if::cfg_if! {
28 if #[cfg(feature = "rustalloc")] {
29 } else if #[cfg(feature = "jemalloc")] {
30 use crate::cli_shared::tikv_jemallocator::Jemalloc;
31 #[global_allocator]
32 static GLOBAL: Jemalloc = Jemalloc;
33 } else if #[cfg(feature = "system-alloc")] {
34 use std::alloc::System;
35 #[global_allocator]
36 static GLOBAL: System = System;
37 }
38}
39
40mod auth;
41mod beacon;
42mod blocks;
43mod chain;
44mod chain_sync;
45mod cid_collections;
46mod cli;
47mod cli_shared;
48mod daemon;
49mod db;
50mod dev;
51mod documentation;
52mod eth;
53mod f3;
54mod fil_cns;
55mod genesis;
56mod health;
57mod interpreter;
58mod ipld;
59mod key_management;
60mod libp2p;
61mod libp2p_bitswap;
62mod lotus_json;
63mod message;
64mod message_pool;
65mod metrics;
66mod networks;
67mod rpc;
68mod shim;
69mod state_manager;
70mod state_migration;
71mod statediff;
72#[cfg(any(test, doc))]
73mod test_utils;
74mod tool;
75mod utils;
76mod wallet;
77
78#[cfg(feature = "doctest-private")]
86#[doc(hidden)]
87pub mod doctest_private {
88 pub use crate::{
89 blocks::{CachingBlockHeader, Ticket, TipsetKey},
90 cli::humantoken::{TokenAmountPretty, parse},
91 shim::{
92 address::Address, crypto::Signature, econ::TokenAmount, error::ExitCode,
93 randomness::Randomness, sector::RegisteredSealProof, state_tree::ActorState,
94 version::NetworkVersion,
95 },
96 utils::io::progress_log::WithProgress,
97 utils::net::{DownloadFileOption, download_to},
98 utils::{encoding::blake2b_256, encoding::keccak_256, io::read_toml},
99 };
100}
101
102#[cfg(feature = "benchmark-private")]
105#[doc(hidden)]
106pub mod benchmark_private;
107
108#[cfg(feature = "interop-tests-private")]
111#[doc(hidden)]
112pub mod interop_tests_private {
113 pub mod libp2p {
114 pub use crate::libp2p::*;
115 }
116 pub mod libp2p_bitswap {
117 pub use crate::libp2p_bitswap::*;
118 }
119 pub mod beacon {
120 pub use crate::beacon::BeaconEntry;
121 }
122}
123
124pub use auth::{JWT_IDENTIFIER, verify_token};
126pub use cli::main::main as forest_main;
127pub use cli_shared::cli::{Client, Config};
128pub use daemon::main::main as forestd_main;
129pub use dev::main::main as forest_dev_main;
130pub use key_management::{
131 ENCRYPTED_KEYSTORE_NAME, FOREST_KEYSTORE_PHRASE_ENV, KEYSTORE_NAME, KeyStore, KeyStoreConfig,
132};
133pub use tool::main::main as forest_tool_main;
134pub use wallet::main::main as forest_wallet_main;
135
136#[cfg(test)]
137fn block_on<T>(f: impl std::future::Future<Output = T>) -> T {
138 tokio::runtime::Builder::new_multi_thread()
139 .enable_all()
140 .build()
141 .unwrap()
142 .block_on(f)
143}