Skip to content

Commit

Permalink
Merge pull request #2626 from b-zee/refactor-remove-discord-owner
Browse files Browse the repository at this point in the history
refactor(node): remove --owner (discord) flag
  • Loading branch information
jacderida authored Jan 14, 2025
2 parents 98bc1b3 + 95f2949 commit 225a5ed
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 549 deletions.
12 changes: 0 additions & 12 deletions ant-node-manager/src/add_services/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub struct InstallNodeServiceCtxBuilder {
pub metrics_port: Option<u16>,
pub node_ip: Option<Ipv4Addr>,
pub node_port: Option<u16>,
pub owner: Option<String>,
pub peers_args: PeersArgs,
pub rewards_address: RewardsAddress,
pub rpc_socket_addr: SocketAddr,
Expand Down Expand Up @@ -132,10 +131,6 @@ impl InstallNodeServiceCtxBuilder {
args.push(OsString::from("--metrics-server-port"));
args.push(OsString::from(metrics_port.to_string()));
}
if let Some(owner) = self.owner {
args.push(OsString::from("--owner"));
args.push(OsString::from(owner));
}
if let Some(log_files) = self.max_archived_log_files {
args.push(OsString::from("--max-archived-log-files"));
args.push(OsString::from(log_files.to_string()));
Expand Down Expand Up @@ -193,7 +188,6 @@ pub struct AddNodeServiceOptions {
pub network_id: Option<u8>,
pub node_ip: Option<Ipv4Addr>,
pub node_port: Option<PortRange>,
pub owner: Option<String>,
pub peers_args: PeersArgs,
pub rewards_address: RewardsAddress,
pub rpc_address: Option<Ipv4Addr>,
Expand Down Expand Up @@ -327,7 +321,6 @@ mod tests {
network_id: None,
node_ip: None,
node_port: None,
owner: None,
peers_args: PeersArgs::default(),
rewards_address: RewardsAddress::from_str("0x03B770D9cD32077cC0bF330c13C114a87643B124")
.unwrap(),
Expand Down Expand Up @@ -363,7 +356,6 @@ mod tests {
network_id: None,
node_ip: None,
node_port: None,
owner: None,
peers_args: PeersArgs::default(),
rewards_address: RewardsAddress::from_str("0x03B770D9cD32077cC0bF330c13C114a87643B124")
.unwrap(),
Expand Down Expand Up @@ -400,7 +392,6 @@ mod tests {
network_id: Some(5),
node_ip: None,
node_port: None,
owner: None,
peers_args: PeersArgs::default(),
rewards_address: RewardsAddress::from_str("0x03B770D9cD32077cC0bF330c13C114a87643B124")
.unwrap(),
Expand Down Expand Up @@ -490,7 +481,6 @@ mod tests {
builder.node_ip = Some(Ipv4Addr::new(192, 168, 1, 1));
builder.node_port = Some(12345);
builder.metrics_port = Some(9090);
builder.owner = Some("test-owner".to_string());
builder.peers_args.addrs = vec![
"/ip4/127.0.0.1/tcp/8080".parse().unwrap(),
"/ip4/192.168.1.1/tcp/8081".parse().unwrap(),
Expand Down Expand Up @@ -531,8 +521,6 @@ mod tests {
"12345",
"--metrics-server-port",
"9090",
"--owner",
"test-owner",
"--max-archived-log-files",
"10",
"--max-log-files",
Expand Down
12 changes: 0 additions & 12 deletions ant-node-manager/src/add_services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ pub async fn add_node(
check_port_availability(port_option, &node_registry.nodes)?;
}

let owner = match &options.owner {
Some(owner) => {
if owner.chars().any(|c| c.is_uppercase()) {
warn!("Owner name ({owner}) contains uppercase characters and will be converted to lowercase");
}
Some(owner.to_lowercase())
}
None => None,
};

let antnode_file_name = options
.antnode_src_path
.file_name()
Expand Down Expand Up @@ -213,7 +203,6 @@ pub async fn add_node(
network_id: options.network_id,
node_ip: options.node_ip,
node_port,
owner: owner.clone(),
peers_args: options.peers_args.clone(),
rewards_address: options.rewards_address,
rpc_socket_addr,
Expand Down Expand Up @@ -254,7 +243,6 @@ pub async fn add_node(
rewards_address: options.rewards_address,
reward_balance: None,
rpc_socket_addr,
owner: owner.clone(),
peer_id: None,
peers_args: options.peers_args.clone(),
pid: None,
Expand Down
Loading

0 comments on commit 225a5ed

Please sign in to comment.