ab_farmer/lib.rs
1#![feature(
2 const_block_items,
3 exact_size_is_empty,
4 fmt_helpers_for_derive,
5 future_join,
6 iter_collect_into,
7 try_blocks
8)]
9#![cfg_attr(
10 test,
11 expect(
12 clippy::rest_pattern_accessible_field,
13 reason = "Too verbose for tests"
14 )
15)]
16#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)]
17// TODO: Remove once https://github.com/gfx-rs/wgpu/pull/9953 is released
18#![recursion_limit = "256"]
19
20//! `ab-farmer` is both a library and an app for everything related to farming.
21//!
22//! # Library
23//!
24//! Library exposes all the necessary utilities for plotting, maintaining and farming plots.
25//! Conceptually [`farm::Farm`] is an abstraction that contains a plot, a small piece cache and
26//! corresponding metadata. [`single_disk_farm::SingleDiskFarm`] is the primary abstraction that
27//! implements [`farm::Farm`] and encapsulates those components stored on local disk with high-level
28//! API with events that allow to orchestrate farms from the outside (for example in CLI).
29//!
30//! While local farming is one option, there is also a way to have cluster setup, implemented in
31//! [`cluster`] module. Cluster contains a special implementation of [`farm::Farm`] and other
32//! components that are not stored on local disk, but rather are somewhere on the network (typically
33//! LAN). This allows to better manage resources, which is primarily useful for large farmers.
34//! Cluster setup usually consists from heterogeneous machines where different machines are
35//! specialized with different tasks (some machines do farming, some plotting, some both, etc.).
36//! Cluster setup also allows for even greater composition and allows for combining various pieces
37//! of the software from different vendors (like unofficial plotters for example).
38//!
39//! Since various key components are implementations of traits, it is possible to use some part of
40//! the library as is (like farming), while swapping others (like plotting). The library is meant to
41//! be somewhat generic and allowing different composition scenarios.
42//!
43//! # CLI
44//!
45//! CLI provides reference implementation of the farmer software, it wraps library components and
46//! orchestrates them as a final user-facing application.
47//!
48//! CLI exposes many key options to fine tune various aspects, but primarily for experimentation and
49//! improving defaults, the goal is for default behavior to be already as optimal as efficient as
50//! possible.
51
52#[cfg(feature = "cluster")]
53pub mod cluster;
54pub mod disk_piece_cache;
55pub mod farm;
56pub mod farmer_cache;
57pub mod farmer_piece_getter;
58pub mod node_client;
59pub mod plotter;
60pub mod single_disk_farm;
61pub mod thread_pool_manager;
62pub mod utils;
63
64/// Size of the LRU cache for peers.
65pub const KNOWN_PEERS_CACHE_SIZE: u32 = 100;