Skip to content

Commit 692907c

Browse files
Execute
1 parent 4e303b9 commit 692907c

File tree

116 files changed

+678
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+678
-700
lines changed

bin/network-monitor/src/cli/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Command-line interface module.
1+
//!Command-line interface module.
22
//!
33
//! This module contains the CLI parsing and command definitions.
44

bin/network-monitor/src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Command implementations.
1+
//!Command implementations.
22
//!
33
//! This module contains the implementations for all available commands.
44

bin/network-monitor/src/commands/start.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Start command implementation.
1+
//!Start command implementation.
22
//!
33
//! This module contains the implementation for starting the network monitoring service.
44
@@ -11,10 +11,10 @@ use crate::config::MonitorConfig;
1111
use crate::frontend::ServerState;
1212
use crate::monitor::tasks::Tasks;
1313

14-
/// Start the network monitoring service.
14+
///Start the network monitoring service.
1515
///
16-
/// This function initializes all monitoring tasks including RPC status checking,
17-
/// remote prover testing, faucet testing, and the web frontend.
16+
/// This function initializes all monitoring tasks including RPC status checking, remote prover
17+
/// testing, faucet testing, and the web frontend.
1818
#[instrument(target = COMPONENT, name = "start-monitor", skip_all, fields(port = %config.port))]
1919
pub async fn start_monitor(config: MonitorConfig) -> Result<()> {
2020
// Load configuration from command-line arguments and environment variables

bin/network-monitor/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Network monitor configuration.
1+
//!Network monitor configuration.
22
//!
33
//! This module contains the configuration structures and constants for the network monitor.
44
//! Configuration for the monitor.
@@ -9,13 +9,13 @@ use std::time::Duration;
99
use clap::Parser;
1010
use url::Url;
1111

12-
// MONITOR CONFIGURATION CONSTANTS
12+
//MONITOR CONFIGURATION CONSTANTS
1313
// ================================================================================================
1414

1515
const DEFAULT_RPC_URL: &str = "http://0.0.0.0:57291";
1616
const DEFAULT_PORT: u16 = 3000;
1717

18-
/// Configuration for the monitor.
18+
///Configuration for the monitor.
1919
///
2020
/// This struct contains the configuration for the monitor.
2121
#[derive(Debug, Clone, Parser)]

bin/network-monitor/src/counter.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! Counter increment task functionality.
1+
//!Counter increment task functionality.
22
//!
3-
//! This module contains the implementation for periodically incrementing the counter
4-
//! of the network account deployed at startup by creating and submitting network notes.
3+
//! This module contains the implementation for periodically incrementing the counter of the network
4+
//! account deployed at startup by creating and submitting network notes.
55
66
use std::path::Path;
77
use std::sync::Arc;
@@ -180,17 +180,17 @@ async fn setup_increment_task(
180180
))
181181
}
182182

183-
/// Run the counter increment task.
183+
///Run the counter increment task.
184184
///
185-
/// This function periodically creates network notes that target the counter account and sends
185+
///This function periodically creates network notes that target the counter account and sends
186186
/// transactions to increment it.
187187
///
188188
/// # Arguments
189189
///
190190
/// * `config` - The monitor configuration containing file paths and intervals.
191191
/// * `tx` - The watch channel sender for status updates.
192192
/// * `expected_counter_value` - Shared atomic counter for tracking expected value based on
193-
/// successful increments.
193+
///successful increments.
194194
///
195195
/// # Returns
196196
///
@@ -313,17 +313,17 @@ fn send_status(tx: &watch::Sender<ServiceStatus>, status: ServiceStatus) -> Resu
313313
Ok(())
314314
}
315315

316-
/// Run the counter tracking task.
316+
///Run the counter tracking task.
317317
///
318-
/// This function periodically fetches the current counter value from the network
319-
/// and updates the tracking details.
318+
///This function periodically fetches the current counter value from the network and updates the
319+
/// tracking details.
320320
///
321321
/// # Arguments
322322
///
323323
/// * `config` - The monitor configuration containing file paths and intervals.
324324
/// * `tx` - The watch channel sender for status updates.
325325
/// * `expected_counter_value` - Shared atomic counter for tracking expected value based on
326-
/// successful increments.
326+
///successful increments.
327327
///
328328
/// # Returns
329329
///

bin/network-monitor/src/deploy/mod.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Account deployment module.
1+
//!Account deployment module.
22
//!
33
//! This module contains functionality for deploying Miden accounts to the network.
44
@@ -40,9 +40,8 @@ use crate::deploy::wallet::{create_wallet_account, save_wallet_account};
4040
pub mod counter;
4141
pub mod wallet;
4242

43-
/// Create an RPC client configured with the correct genesis metadata in the
44-
/// `Accept` header so that write RPCs such as `SubmitProvenTransaction` are
45-
/// accepted by the node.
43+
/// Create an RPC client configured with the correct genesis metadata in the `Accept` header so that
44+
/// write RPCs such as `SubmitProvenTransaction` are accepted by the node.
4645
pub async fn create_genesis_aware_rpc_client(
4746
rpc_url: &Url,
4847
timeout: Duration,
@@ -96,11 +95,10 @@ pub async fn create_genesis_aware_rpc_client(
9695
Ok(rpc_client)
9796
}
9897

99-
/// Ensure accounts exist, creating them if they don't.
98+
///Ensure accounts exist, creating them if they don't.
10099
///
101-
/// This function checks if the wallet and counter account files exist.
102-
/// If they don't exist, it creates new accounts and saves them to the specified files.
103-
/// If they do exist, it does nothing.
100+
///This function checks if the wallet and counter account files exist. If they don't exist, it
101+
/// creates new accounts and saves them to the specified files. If they do exist, it does nothing.
104102
///
105103
/// # Arguments
106104
///
@@ -139,10 +137,9 @@ pub async fn ensure_accounts_exist(
139137
save_counter_account(&counter_account, counter_filepath)
140138
}
141139

142-
/// Deploy counter account to the network.
140+
///Deploy counter account to the network.
143141
///
144-
/// This function creates a counter program account,
145-
/// then saves it to the specified file.
142+
/// This function creates a counter program account, then saves it to the specified file.
146143
#[instrument(target = COMPONENT, name = "deploy-counter-account", skip_all, ret(level = "debug"))]
147144
pub async fn deploy_counter_account(counter_account: &Account, rpc_url: &Url) -> Result<()> {
148145
// Deploy counter account to the network using a genesis-aware RPC client.
@@ -224,7 +221,7 @@ pub(crate) fn get_counter_library() -> Result<Library> {
224221
.map_err(|e| anyhow::anyhow!("Failed to assemble library: {e}"))
225222
}
226223

227-
// MONITOR DATA STORE
224+
//MONITOR DATA STORE
228225
// ================================================================================================
229226

230227
/// A [`DataStore`] implementation for the network monitor.

bin/network-monitor/src/deploy/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use tracing::instrument;
1515

1616
use crate::COMPONENT;
1717

18-
/// Create a wallet account with `RpoFalcon512` authentication.
18+
///Create a wallet account with `RpoFalcon512` authentication.
1919
///
2020
/// Returns the created account and the secret key for authentication.
2121
#[instrument(target = COMPONENT, name = "create-wallet-account", skip_all, ret(level = "debug"))]

bin/network-monitor/src/faucet.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! Faucet testing functionality.
1+
//!Faucet testing functionality.
22
//!
3-
//! This module contains the logic for periodically testing faucet functionality
4-
//! by requesting proof-of-work challenges, solving them, and submitting token requests.
3+
//! This module contains the logic for periodically testing faucet functionality by requesting
4+
//! proof-of-work challenges, solving them, and submitting token requests.
55
66
use std::time::Duration;
77

@@ -20,15 +20,15 @@ use url::Url;
2020
use crate::status::{ServiceDetails, ServiceStatus, Status};
2121
use crate::{COMPONENT, current_unix_timestamp_secs};
2222

23-
// CONSTANTS
23+
//CONSTANTS
2424
// ================================================================================================
2525

2626
/// Maximum number of attempts to solve a `PoW` challenge.
2727
const MAX_CHALLENGE_ATTEMPTS: u64 = 100_000_000;
2828
/// Amount of tokens to mint.
2929
const MINT_AMOUNT: u64 = 1_000_000; // 1 token with 6 decimals
3030

31-
// FAUCET TEST TYPES
31+
//FAUCET TEST TYPES
3232
// ================================================================================================
3333

3434
/// Details of a faucet test.
@@ -71,12 +71,12 @@ pub struct GetMetadataResponse {
7171
version: Option<String>,
7272
}
7373

74-
// FAUCET TEST TASK
74+
//FAUCET TEST TASK
7575
// ================================================================================================
7676

77-
/// Runs a task that continuously tests faucet functionality and updates a watch channel.
77+
///Runs a task that continuously tests faucet functionality and updates a watch channel.
7878
///
79-
/// This function spawns a task that periodically requests proof-of-work challenges from the faucet,
79+
///This function spawns a task that periodically requests proof-of-work challenges from the faucet,
8080
/// solves them, and submits token requests to verify the faucet is operational.
8181
///
8282
/// # Arguments
@@ -157,7 +157,7 @@ pub async fn run_faucet_test_task(
157157
}
158158
}
159159

160-
/// Performs a complete faucet test by requesting a `PoW` challenge and submitting the solution.
160+
///Performs a complete faucet test by requesting a `PoW` challenge and submitting the solution.
161161
///
162162
/// # Arguments
163163
///
@@ -237,7 +237,7 @@ async fn perform_faucet_test(
237237
Ok((tokens_response, metadata))
238238
}
239239

240-
/// Solves a proof-of-work challenge using SHA-256 hashing.
240+
///Solves a proof-of-work challenge using SHA-256 hashing.
241241
///
242242
/// # Arguments
243243
///

bin/network-monitor/src/frontend.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::COMPONENT;
1414
use crate::config::MonitorConfig;
1515
use crate::status::{NetworkStatus, ServiceStatus};
1616

17-
// SERVER STATE
17+
//SERVER STATE
1818
// ================================================================================================
1919

2020
/// State for the web server containing watch receivers for all services.
@@ -27,9 +27,9 @@ pub struct ServerState {
2727
pub ntx_tracking: Option<watch::Receiver<ServiceStatus>>,
2828
}
2929

30-
/// Runs the frontend server.
30+
///Runs the frontend server.
3131
///
32-
/// This function runs the frontend server that serves the dashboard and the status data.
32+
///This function runs the frontend server that serves the dashboard and the status data.
3333
///
3434
/// # Arguments
3535
///

bin/network-monitor/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! Miden Network Monitor
1+
//!Miden Network Monitor
22
//!
3-
//! A monitor application for Miden network infrastructure that provides real-time status
4-
//! monitoring and account deployment capabilities.
3+
//! A monitor application for Miden network infrastructure that provides real-time status monitoring
4+
//! and account deployment capabilities.
55
66
use anyhow::Result;
77
use clap::Parser;
@@ -26,10 +26,10 @@ pub use monitor::tasks::current_unix_timestamp_secs;
2626
/// Component identifier for structured logging and tracing
2727
pub const COMPONENT: &str = "miden-network-monitor";
2828

29-
/// Network Monitor main function.
29+
///Network Monitor main function.
3030
///
31-
/// This function parses command-line arguments and delegates to the appropriate
32-
/// command handler. The monitor supports two main commands:
31+
///This function parses command-line arguments and delegates to the appropriate command handler.
32+
/// The monitor supports two main commands:
3333
/// - `start`: Runs the network monitoring service with web dashboard
3434
/// - `deploy-account`: Creates and deploys Miden accounts to the network
3535
#[tokio::main]

0 commit comments

Comments
 (0)