-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into upgrade-polkadot-sdk
- Loading branch information
Showing
11 changed files
with
552 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,11 @@ | ||
[package] | ||
name = "handover" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
clap = { workspace = true, features = ["derive"] } | ||
tokio = { workspace = true, features = ["full"] } | ||
walkdir = { workspace = true } |
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,65 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command( | ||
about = "xxx", | ||
version, | ||
author | ||
)] | ||
pub struct Args { | ||
#[arg( | ||
long, | ||
help = "The backup path of the each version of ceseal", | ||
default_value = "/opt/ceseal/backups" | ||
)] | ||
pub previous_version_ceseal_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "The backup path of the current version of ceseal", | ||
default_value = "/opt/ceseal/releases/current" | ||
)] | ||
pub current_version_ceseal_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "ceseal home", | ||
default_value = "/opt/ceseal/data" | ||
)] | ||
pub ceseal_data_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "Ceseal log path for detect the status of previous ceseal", | ||
default_value = "/tmp/pre_ceseal.log" | ||
)] | ||
pub previous_ceseal_log_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "Ceseal log path for detect the status of new ceseal", | ||
default_value = "/tmp/new_ceseal.log" | ||
)] | ||
pub new_ceseal_log_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "The relative path where each version of ceseal stores protected files", | ||
default_value = "data/protected_files" | ||
)] | ||
pub ceseal_protected_files_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "the relative path where each version of ceseal stores checkpoint file", | ||
default_value = "data/storage_files" | ||
)] | ||
pub ceseal_storage_files_path: String, | ||
|
||
#[arg( | ||
long, | ||
help = "old ceseal start on this port", | ||
default_value = "1888" | ||
)] | ||
pub previous_ceseal_port: u64, | ||
} |
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,24 @@ | ||
use std::{error, fmt}; | ||
|
||
#[derive(Debug)] | ||
pub enum Error { | ||
StartCesealFailed(String), | ||
RedirectCesealLogFailed(String), | ||
DetectCesealRunningStatueFailed(String), | ||
PreviousVersionFailed(String), | ||
CopyDirectory(String) | ||
} | ||
|
||
impl fmt::Display for Error { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
Error::StartCesealFailed(e) => write!(f, "{:?}", e), | ||
Error::RedirectCesealLogFailed(e) => write!(f, "{:?}", e), | ||
Error::DetectCesealRunningStatueFailed(e) => write!(f, "{:?}", e), | ||
Error::PreviousVersionFailed(e) => write!(f, "{:?}", e), | ||
Error::CopyDirectory(e) => write!(f, "{:?}", e), | ||
} | ||
} | ||
} | ||
|
||
impl error::Error for Error {} |
Oops, something went wrong.