-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dd42b3
commit 7882ac9
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use services::m1::localnet; | ||
use async_trait::async_trait; | ||
use clap::Parser; | ||
use util::{cli::Command, util::util::constructor::ConstructorOperations}; | ||
use crate::manage::{ | ||
InstallationArgs, | ||
VersionArgs | ||
}; | ||
use util::util::util::Version; | ||
use util::service::ServiceOperations; | ||
use util::movement_dir::MovementDir; | ||
|
||
#[derive(Debug, Parser, Clone)] | ||
pub struct Localnet { | ||
|
||
#[clap(flatten)] | ||
pub version_args : VersionArgs, | ||
|
||
#[clap(flatten)] | ||
pub installation_args : InstallationArgs | ||
|
||
} | ||
|
||
impl Into<localnet::Config> for Localnet { | ||
fn into(self) -> localnet::Config { | ||
localnet::Config | ||
} | ||
} | ||
|
||
|
||
#[async_trait] | ||
impl Command<String> for Localnet { | ||
|
||
async fn get_name(&self) -> String { | ||
"localnet".to_string() | ||
} | ||
|
||
async fn execute(self) -> Result<String, anyhow::Error> { | ||
|
||
let movement_dir = MovementDir::default(); | ||
|
||
// todo: handle config and version | ||
let config : localnet::Config = self.clone().into(); | ||
let version : Version = self.version_args.try_into()?; | ||
|
||
let service = localnet::Constructor::default(); | ||
|
||
service.start(&movement_dir).await?; | ||
|
||
Ok("SUCCESS".to_string()) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ pub mod proxy; | |
pub mod mevm; | ||
pub mod testnet; | ||
pub mod indexer; | ||
pub mod localnet; | ||
pub mod m1; | ||
pub use m1::*; |