Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(node): make owner optional #1680

Merged
merged 1 commit into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading