generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
8 changed files
with
105 additions
and
4 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
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
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
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,19 @@ | ||
|
||
mod purge; | ||
use anyhow::*; | ||
use clap::Subcommand; | ||
use config::AppConfig; | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum P2pCommands { | ||
/// Purge the current peer id from the database. | ||
Purge | ||
} | ||
|
||
pub async fn execute(command: P2pCommands, config: AppConfig) -> Result<()> { | ||
match command { | ||
P2pCommands::Purge => purge::execute(&config).await?, | ||
}; | ||
|
||
Ok(()) | ||
} |
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,13 @@ | ||
use actix::Actor; | ||
use anyhow::*; | ||
use config::AppConfig; | ||
use enclave_core::EventBus; | ||
use enclave_node::get_repositories; | ||
|
||
pub async fn execute(config: &AppConfig) -> Result<()> { | ||
let bus = EventBus::new(true).start(); | ||
let repositories = get_repositories(&config, &bus)?; | ||
repositories.libp2pid().clear(); | ||
println!("Peer ID has been purged. A new peer will be generated upon restart."); | ||
Ok(()) | ||
} |
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