subspace_farmer/
lib.rs

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