Skip to content

Commit

Permalink
chore(node): make owner optional
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin authored and joshuef committed May 8, 2024
1 parent cfe6da8 commit 756aa58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sn_node/src/bin/safenode/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct Opt {

/// Specify the owner(readable discord user name).
#[clap(long)]
owner: String,
owner: Option<String>,

#[cfg(feature = "open-metrics")]
/// Specify the port for the OpenMetrics server.
Expand Down Expand Up @@ -197,14 +197,19 @@ fn main() -> Result<()> {
// another process with these args.
#[cfg(feature = "metrics")]
rt.spawn(init_metrics(std::process::id()));
let owner = if let Some(owner) = opt.owner {
owner.clone()
} else {
"user".to_owned()
};
let restart_options = rt.block_on(async move {
let mut node_builder = NodeBuilder::new(
keypair,
node_socket_addr,
bootstrap_peers,
opt.local,
root_dir,
opt.owner.clone(),
owner,
#[cfg(feature = "upnp")]
opt.upnp,
);
Expand Down

0 comments on commit 756aa58

Please sign in to comment.