subspace_farmer/
lib.rs

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