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