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