Skip to content

Commit

Permalink
Rename p2p to net
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Dec 2, 2024
1 parent bf3be51 commit 0249150
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions packages/ciphernode/enclave/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ pub mod aggregator;
pub mod password;
pub mod start;
pub mod wallet;
pub mod p2p;
pub mod net;

use self::password::PasswordCommands;
use aggregator::AggregatorCommands;
use clap::Subcommand;
use p2p::P2pCommands;
use net::NetCommands;
use wallet::WalletCommands;

#[derive(Subcommand, Debug)]
Expand All @@ -33,9 +33,9 @@ pub enum Commands {
command: WalletCommands,
},

/// Peer related commands
P2p {
/// Networking related commands
Net {
#[command(subcommand)]
command: P2pCommands
command: NetCommands
}
}
19 changes: 19 additions & 0 deletions packages/ciphernode/enclave/src/commands/net/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

mod purge;
use anyhow::*;
use clap::Subcommand;
use config::AppConfig;

#[derive(Subcommand, Debug)]
pub enum NetCommands {
/// Purge the current peer ID from the database.
PurgeId
}

pub async fn execute(command: NetCommands, config: AppConfig) -> Result<()> {
match command {
NetCommands::PurgeId => purge::execute(&config).await?,
};

Ok(())
}
19 changes: 0 additions & 19 deletions packages/ciphernode/enclave/src/commands/p2p/mod.rs

This file was deleted.

4 changes: 2 additions & 2 deletions packages/ciphernode/enclave/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use clap::Parser;
use commands::{aggregator, p2p, password, start, wallet, Commands};
use commands::{aggregator, net, password, start, wallet, Commands};
use config::load_config;
use enclave_core::{get_tag, set_tag};
use tracing::instrument;
Expand Down Expand Up @@ -53,7 +53,7 @@ impl Cli {
Commands::Password { command } => password::execute(command, config).await?,
Commands::Aggregator { command } => aggregator::execute(command, config).await?,
Commands::Wallet { command } => wallet::execute(command, config).await?,
Commands::P2p { command } => p2p::execute(command, config).await?
Commands::Net { command } => net::execute(command, config).await?
}

Ok(())
Expand Down

0 comments on commit 0249150

Please sign in to comment.