diff --git a/client/distance/src/lib.rs b/client/distance/src/lib.rs index 1ec5f2feca88ecb8286da0263c61243aaedf387a..df2e2451bc695a02d9f5a2c908bf42bd61f1f6e5 100644 --- a/client/distance/src/lib.rs +++ b/client/distance/src/lib.rs @@ -14,6 +14,26 @@ // You should have received a copy of the GNU Affero General Public License // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>. +//! # Distance Oracle Inherent Data Provider +//! +//! This crate provides functionality for creating an **inherent data provider** +//! specifically designed for the "Distance Oracle". +//! The inherent data provider is responsible for fetching and delivering +//! computation results required for the runtime to process distance evaluations. +//! +//! ## Relationship with Distance Oracle +//! +//! The **distance-oracle** is responsible for computing distance evaluations, +//! storing the results to be read in the next period, and saving them to files. +//! These files are then read by **this inherent data provider** +//! to provide the required data to the runtime. +//! +//! ## Overview +//! +//! - Retrieves **period index** and **evaluation results** from the storage and file system. +//! - Determines whether the computation results for the current period have already been published. +//! - Reads and parses evaluation result files when available, providing the necessary data to the runtime. + use frame_support::pallet_prelude::*; use sc_client_api::{ProvideUncles, StorageKey, StorageProvider}; use sp_runtime::{generic::BlockId, traits::Block as BlockT, AccountId32}; diff --git a/distance-oracle/src/lib.rs b/distance-oracle/src/lib.rs index d1f3ef4688468cc5af90d737d809f644b8853388..a801037752205edd676c8ae3645b54a2919e6ae1 100644 --- a/distance-oracle/src/lib.rs +++ b/distance-oracle/src/lib.rs @@ -16,7 +16,9 @@ //! # Distance Oracle //! -//! The **Distance Oracle** is a standalone program designed to calculate the distances between identities in the Duniter Web of Trust (WoT). This process is computationally intensive and is therefore decoupled from the main runtime. It allows smiths user to choose whether to run the oracle and provide results to the network. +//! The **Distance Oracle** is a standalone program designed to calculate the distances between identities in the Duniter Web of Trust (WoT). This process is computationally intensive and is therefore decoupled from the main runtime. It allows smith users to choose whether to run the oracle and provide results to the network. +//! +//! The **oracle** works in conjunction with the **Inherent Data Provider** and the **Distance Pallet** in the runtime to deliver periodic computation results. The **Inherent Data Provider** fetches and supplies these results to the runtime, ensuring that the necessary data for distance evaluations is available to be processed at the appropriate time in the runtime lifecycle. //! //! ## Structure //! @@ -24,13 +26,13 @@ //! //! 1. **`/distance-oracle/`**: Contains the main binary for executing the distance computation. //! 2. **`/primitives/distance/`**: Defines primitive types shared between the client and runtime. -//! 3. **`/client/distance/`**: Exposes the `create_distance_inherent_data_provider`, which feeds data into the runtime. -//! 4. **`/pallets/distance/`**: A pallet that handles distance-related types, traits, storage, and hooks in the runtime. +//! 3. **`/client/distance/`**: Exposes the `create_distance_inherent_data_provider`, which feeds data into the runtime through the Inherent Data Provider. +//! 4. **`/pallets/distance/`**: A pallet that handles distance-related types, traits, storage, and hooks in the runtime, coordinating the interaction between the oracle, inherent data provider, and runtime. //! //! ## How it works -//! - The pallet distance adds an evaluation request at period `i`. -//! - The oracle evaluates this request at period `i + 1`. -//! - The inherent takes this evaluation result at period `i + 2` and performs the required operation in the runtime. +//! - The **Distance Pallet** adds an evaluation request at period `i` in the runtime. +//! - The **Distance Oracle** evaluates this request at period `i + 1`, computes the necessary results and stores them on disk. +//! - The **Inherent Data Provider** reads this evaluation result from disk at period `i + 2` and provides it to the runtime to perform the required operations. //! //! ## Usage //! diff --git a/node/src/lib.rs b/node/src/lib.rs index caf6e6f327cfa0eda6ce001d9a153aae8f1f4401..2e557430013a21a5918a9ea56e3f4decfc38d470 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -14,6 +14,54 @@ // You should have received a copy of the GNU Affero General Public License // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. +//! # Duniter v2s Documentation +//! +//! 🆙 A rewriting of [Duniter v1](https://duniter.org) in the [Substrate](https://www.substrate.io/) framework. +//! +//! ⚠️ Duniter-v2s is under active development. +//! +//! 🚧 A test network called "ĞDev" is deployed, allowing testing of wallets and indexers. +//! +//! ## Crate Overview +//! +//! This workspace consists of multiple crates that collaboratively implement the Duniter node, enabling features such as identity management, Web of Trust (WoT) evaluation, universal dividend calculation, and more. Below is a categorized list of crates within this workspace: +//! +//! ### Core Components +//! - [`client/distance`](../dc_distance/index.html): Provides an inherent data provider for distance evaluation in the Web of Trust. +//! - [`distance-oracle`](../distance_oracle/index.html): A standalone tool for performing computationally intensive Web of Trust distance calculations. +//! - [`node`](../duniter/index.html): The main node implementation for running the Duniter blockchain network. +//! +//! ### Testing Utilities +//! - [`end2end-tests`](../duniter_end2end_tests/index.html): End-to-end tests for validating the entire Duniter workflow. +//! - [`live-tests`](../duniter_live_tests/index.html): Live test cases for ensuring the integrity of the chain. +//! +//! ### Pallets (Runtime Modules) +//! - [`pallets/authority-members`](../pallet_authority_members/index.html): Manages the authority members. +//! - [`pallets/certification`](../pallet_certification/index.html): Handles identity certification. +//! - [`pallets/distance`](../pallet_distance/index.html): Implements the storage and logic for WoT distance calculations. +//! - [`pallets/duniter-test-parameters`](../pallet_duniter_test_parameters/index.html): Provides runtime testing parameters. +//! - [`pallets/duniter-test-parameters/macro`](../pallet_duniter_test_parameters_macro/index.html): Macros to simplify testing configurations. +//! - [`pallets/duniter-wot`](../pallet_duniter_wot/index.html): Core logic for managing the WoT. +//! - [`pallets/identity`](../pallet_identity/index.html): Implements identity management. +//! - [`pallets/membership`](../pallet_membership/index.html): Manages memberships. +//! - [`pallets/oneshot-account`](../pallet_oneshot_account/index.html): Manages one-shot accounts. +//! - [`pallets/quota`](../pallet_quota/index.html): Manages users quotas. +//! - [`pallets/smith-members`](../pallet_smith_members/index.html): Manages smiths. +//! - [`pallets/universal-dividend`](../pallet_universal_dividend/index.html): Handles the logic for distributing universal dividends. +//! - [`pallets/upgrade-origin`](../pallet_upgrade_origin/index.html): Ensures secure origins for runtime upgrades. +//! +//! ### Shared Primitives +//! - [`primitives/distance`](../sp_distance/index.html): Shared types and logic for distance evaluations. +//! - [`primitives/membership`](../sp_membership/index.html): Shared primitives for membership-related operations. +//! +//! ### Tooling and Utilities +//! - [`resources/weight_analyzer`](../weightanalyzer/index.html): Provides tools for analyzing runtime weights. +//! - [`runtime/common`](../common_runtime/index.html): Shared components and utilities used across multiple runtimes. +//! - [`runtime/gdev`](../gdev_runtime/index.html): The runtime implementation for the GDEV test network. +//! - [`runtime/g1`](../g1_runtime/index.html): The runtime implementation for the G1 test network. +//! - [`runtime/gtest`](../gtest_runtime/index.html): The runtime implementation for the GTEST test network. +//! - [`xtask`](../xtask/index.html): A custom xtask runner to automate release and testing. + pub mod chain_spec; pub mod cli; pub mod command;