Skip to content

Commit

Permalink
feat: Add default p2p node type
Browse files Browse the repository at this point in the history
  • Loading branch information
aidan46 committed Jan 7, 2025
1 parent 1647ce3 commit 64987d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion storage-provider/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub struct ServerArguments {
parallel_prove_commits: NonZero<usize>,

/// P2P Node type, can be either a bootstrap node or a registration node.
#[arg(long)]
#[arg(long, default_value = "bootstrap")]
node_type: NodeType,

/// Path to P2P config file
Expand Down
7 changes: 7 additions & 0 deletions storage-provider/server/src/p2p.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
fmt::Display,
fs::read_to_string,
path::{Path, PathBuf},
};
Expand All @@ -23,6 +24,12 @@ pub enum NodeType {
Register,
}

impl Display for NodeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}

#[derive(Debug, thiserror::Error)]
pub enum P2PError {
#[error(transparent)]
Expand Down

0 comments on commit 64987d6

Please sign in to comment.