Skip to content

Commit

Permalink
[naming] rename start to serve to differentiate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliciss committed Jul 7, 2023
1 parent 20e24bd commit 5a3607a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/rooch/src/commands/relay/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0

pub mod start;
pub mod serve;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rooch_ws_relay::server::config;
use console_subscriber::ConsoleLayer;

#[derive(Debug, Parser)]
pub struct StartCommand {
pub struct ServeCommand {
#[clap(long = "database")]
/// Use a directory as the location of the database
db: Option<String>,
Expand All @@ -29,7 +29,7 @@ pub struct StartCommand {
}

#[async_trait]
impl CommandAction<()> for StartCommand {
impl CommandAction<()> for ServeCommand {
async fn execute(self) -> RoochResult<()> {
// get config file name from args
let config_file_arg = self.config;
Expand Down Expand Up @@ -68,7 +68,7 @@ impl CommandAction<()> for StartCommand {
tracing_subscriber::fmt::try_init().unwrap();
}
}
info!("Starting up ws relay");
info!("Serving Rooch ws relay");

// get database directory from args
let db_dir_arg = self.db;
Expand Down
6 changes: 3 additions & 3 deletions crates/rooch/src/commands/relay/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub mod commands;
use crate::cli_types::CommandAction;
use async_trait::async_trait;
use clap::Parser;
use commands::start::StartCommand;
use commands::serve::ServeCommand;
use rooch_types::error::RoochResult;

#[derive(Parser)]
Expand All @@ -19,13 +19,13 @@ pub struct Relay {
impl CommandAction<String> for Relay {
async fn execute(self) -> RoochResult<String> {
match self.cmd {
RelayCommand::Start(start) => start.execute_serialized().await,
RelayCommand::Serve(serve) => serve.execute_serialized().await,
}
}
}

#[derive(clap::Subcommand)]
#[clap(name = "relay")]
pub enum RelayCommand {
Start(StartCommand),
Serve(ServeCommand),
}

0 comments on commit 5a3607a

Please sign in to comment.