Skip to content

Commit

Permalink
[fix]: fix doc comments
Browse files Browse the repository at this point in the history
Co-authored-by: Ekaterina Mekhnetsova <[email protected]>
  • Loading branch information
Erigara and outoftardis authored Jul 8, 2022
1 parent 7631c1e commit 3d95a33
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
6 changes: 3 additions & 3 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ pub mod derive {
/// assert_eq!(ip.ip, Ipv4Addr::new(127, 0, 0, 1));
/// ```
pub use iroha_config_derive::Configurable;
/// Derive macro for conversation between type and it's view which contains only subset of type's fields.
/// Derive macro for conversation between a type and its view. which contains a subset of the fields that the type has.
///
/// Works only with structs.
///
/// Assumptions:
/// - View's fields are subset of type's fields;
/// - The fields in `View` are a subset of the fields in the corresponding type.
/// - Type implements `Default`.
///
/// ## Container attributes
Expand All @@ -73,7 +73,7 @@ pub mod derive {
///
/// ## Field attributes
/// ### `#[view(ignore)]`
/// Mark field to ignore it when converting to view type.
/// Marks fields to ignore when converting to view type.
///
/// ## Examples
///
Expand Down
66 changes: 34 additions & 32 deletions data_model/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use iroha_crypto::prelude::*;
use serde::{Deserialize, Serialize};

/// Configuration parameters container.
/// Configuration parameters for a peer
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct Configuration {
/// Module for network-related configuration and structs.
pub mod network {
use super::*;
/// Network Configuration parameters container.
/// Network Configuration parameters
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
Expand All @@ -55,11 +55,11 @@ pub mod kura {
#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
/// Possible modes: `strict`, `fast`.
/// Initialization mode: `strict` or `fast`.
pub init_mode: Mode,
/// Path to the existing block store folder or path to create new folder.
pub block_store_path: String,
/// Maximum number of blocks to write into single storage file
/// Maximum number of blocks to write into a single storage file
pub blocks_per_storage_file: core::num::NonZeroU64,
/// Default buffer capacity of actor's MPSC channel
pub actor_channel_capacity: u32,
Expand All @@ -80,19 +80,19 @@ pub mod kura {
pub mod sumeragi {
use super::*;
/// `SumeragiConfiguration` provides an ability to define parameters such as `BLOCK_TIME_MS`
/// and list of `TRUSTED_PEERS`.
/// and the list of `TRUSTED_PEERS`.
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
/// Current Peer Identification.
pub peer_id: crate::peer::Id,
/// Amount of time peer waits for the `CreatedBlock` message after getting a `TransactionReceipt`
/// The amount of time a peer waits for the `CreatedBlock` message after getting a `TransactionReceipt`
pub block_time_ms: u64,
/// Optional list of predefined trusted peers.
pub trusted_peers: TrustedPeers,
/// Amount of time Peer waits for CommitMessage from the proxy tail.
/// The amount of time a peer waits for `CommitMessage` from the proxy tail.
pub commit_time_limit_ms: u64,
/// Amount of time Peer waits for TxReceipt from the leader.
/// The amount of time a peer waits for `TxReceipt` from the leader.
pub tx_receipt_time_limit_ms: u64,
/// Limits to which transactions must adhere
pub transaction_limits: crate::transaction::TransactionLimits,
Expand All @@ -104,23 +104,25 @@ pub mod sumeragi {
pub gossip_period_ms: u64,
}

/// `SumeragiConfiguration` provides an ability to define parameters
/// such as `BLOCK_TIME_MS` and list of `TRUSTED_PEERS`.
/// The list of trusted peers
#[derive(Debug, Clone, Default, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
#[serde(transparent)]
pub struct TrustedPeers {
/// Optional list of predefined trusted peers. Must contain unique
/// entries. Custom deserializer raises error if duplicates found.
/// entries.
///
/// # Errors
/// Custom deserializer raises an error if there are duplicates.
pub peers: std::collections::HashSet<crate::peer::Id>,
}
}

/// Module for torii-related configuration and structs.
pub mod torii {
use super::*;
/// Structure that defines the configuration parameters of `Torii` which is the routing module.
/// For example the `p2p_addr`, which is used for consensus and block-synchronisation purposes,
/// Structure that defines the configuration parameters of `Torii`, the routing module.
/// This includes parameters such as `p2p_addr`, which is used for consensus and block-synchronisation purposes,
/// as well as `max_transaction_size`.
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
Expand All @@ -131,9 +133,9 @@ pub mod torii {
pub api_url: String,
/// Torii URL for reporting internal status and metrics for administration.
pub telemetry_url: String,
/// Maximum number of bytes in raw transaction. Used to prevent from DOS attacks.
/// Maximum number of bytes in a raw transaction. Used to prevent DOS attacks.
pub max_transaction_size: u32,
/// Maximum number of bytes in raw message. Used to prevent from DOS attacks.
/// Maximum number of bytes in a raw message. Used to prevent DOS attacks.
pub max_content_len: u32,
}
}
Expand All @@ -146,7 +148,7 @@ pub mod block_sync {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
/// The time between sending requests for latest block.
/// The period of time to wait between sending requests for the latest block.
pub gossip_period_ms: u64,
/// The number of blocks that can be sent in one message.
/// Underlying network (`iroha_network`) should support transferring messages this large.
Expand All @@ -166,9 +168,9 @@ pub mod queue {
pub struct Configuration {
/// The upper limit of the number of transactions per block.
pub maximum_transactions_in_block: u32,
/// The upper limit of the number of transactions waiting in this queue.
/// The upper limit of the number of transactions waiting in the queue.
pub maximum_transactions_in_queue: u32,
/// The transaction will be dropped after this time if it is still in a `Queue`.
/// The transaction will be dropped after this time if it is still in the queue.
pub transaction_time_to_live_ms: u64,
/// The threshold to determine if a transaction has been tampered to have a future timestamp.
pub future_threshold_ms: u64,
Expand All @@ -189,7 +191,7 @@ pub mod logger {
pub telemetry_capacity: u32,
/// Compact mode (no spans from telemetry)
pub compact_mode: bool,
/// If provided, logs will be copied to said file in the
/// If provided, logs will be copied to the given file in the
/// format readable by [bunyan](https://lib.rs/crates/bunyan)
pub log_file_path: Option<std::path::PathBuf>,
/// Enable ANSI terminal colors for formatted output.
Expand Down Expand Up @@ -221,14 +223,14 @@ pub mod genesis {
#[serde(rename_all = "UPPERCASE")]
/// Configuration of the genesis block and the process of its submission.
pub struct Configuration {
/// The genesis account public key, should be supplied to all peers.
/// The public key of the genesis account, should be supplied to all peers.
pub account_public_key: PublicKey,
/// Number of attempts to connect to peers, while waiting for them to submit genesis.
/// The number of attempts to connect to peers while waiting for them to submit genesis.
pub wait_for_peers_retry_count_limit: u64,
/// Period in milliseconds in which to retry connecting to peers, while waiting for them to submit genesis.
/// The period in milliseconds in which to retry connecting to peers while waiting for them to submit genesis.
pub wait_for_peers_retry_period_ms: u64,
/// Delay before genesis block submission after minimum number of peers were discovered to be online.
/// Used to ensure that other peers had time to connect to each other.
/// The delay before genesis block submission after minimum number of peers were discovered to be online.
/// The delay between submissions, which is used to ensure that other peers had time to connect to each other.
pub genesis_submission_delay_ms: u64,
}
}
Expand All @@ -244,13 +246,13 @@ pub mod wsv {
pub struct Configuration {
/// [`MetadataLimits`] for every asset with store.
pub asset_metadata_limits: MetadataLimits,
/// [`MetadataLimits`] of any asset definition's metadata.
/// [`MetadataLimits`] of any asset definition metadata.
pub asset_definition_metadata_limits: MetadataLimits,
/// [`MetadataLimits`] of any account's metadata.
/// [`MetadataLimits`] of any account metadata.
pub account_metadata_limits: MetadataLimits,
/// [`MetadataLimits`] of any domain's metadata.
/// [`MetadataLimits`] of any domain metadata.
pub domain_metadata_limits: MetadataLimits,
/// [`LengthLimits`] for the number of chars in identifiers that can be stored in the WSV.
/// [`LengthLimits`] for the number of characters in identifiers that can be stored in the WSV.
pub ident_length_limits: LengthLimits,
/// WASM Runtime configuration
pub wasm_runtime_config: wasm::Configuration,
Expand All @@ -277,19 +279,19 @@ pub mod wasm {
pub mod telemetry {
use super::*;

/// Configuration parameters container
/// Telemetry configuration parameters
#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)]
#[serde(rename_all = "UPPERCASE")]
pub struct Configuration {
/// The node's name to be seen on the telemetry
/// The name of the telemetry node
pub name: Option<String>,
/// The url of the telemetry, e.g., ws://127.0.0.1:8001/submit
pub url: Option<url::Url>,
/// The minimum period of time in seconds to wait before reconnecting
pub min_retry_period: u64,
/// The maximum exponent of 2 that is used for increasing delay between reconnections
/// The maximum exponent of 2 that is used for increasing the delay between reconnections
pub max_retry_delay_exponent: u8,
/// The filepath that to write dev-telemetry to
/// The path to a file for writing the dev-telemetry output
#[cfg(feature = "dev-telemetry")]
pub file: Option<std::path::PathBuf>,
}
Expand Down

0 comments on commit 3d95a33

Please sign in to comment.