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