Skip to content

Commit

Permalink
feat: uniform behaviour for all add commands
Browse files Browse the repository at this point in the history
The three `add` commands for `safenode`, `safenodemand` and `faucet` now behave in a uniform way,
all supporting `--path`, `--url` and `--version` arguments. These enable a binary to be provided via
a path, a URL pointing to a tar/zip containing the binary, or by a specific version number,
respectively.

The `safenodemand` service also now supports running as a non-root user.
  • Loading branch information
jacderida committed Mar 15, 2024
1 parent 13b0851 commit 951b167
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 143 deletions.
98 changes: 41 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sn_node_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ service-manager = "0.6.0"
sn_peers_acquisition = { path = "../sn_peers_acquisition", version = "0.2.8" }
sn_protocol = { path = "../sn_protocol", version = "0.15.4" }
sn_service_management = { path = "../sn_service_management", version = "0.1.0" }
sn-releases = "0.1.7"
sn-releases = { git = "https://github.com/jacderida/sn-releases", branch = "add-daemon-release" }
sn_transfers = { path = "../sn_transfers", version = "0.16.4" }
sysinfo = "0.29.10"
tokio = { version = "1.26", features = ["full"] }
Expand Down
12 changes: 6 additions & 6 deletions sn_node_manager/src/add_services/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ pub struct AddNodeServiceOptions {
pub local: bool,
pub node_port: Option<PortRange>,
pub rpc_address: Option<Ipv4Addr>,
pub safenode_bin_path: PathBuf,
pub safenode_src_path: PathBuf,
pub safenode_dir_path: PathBuf,
pub service_data_dir_path: PathBuf,
pub service_log_dir_path: PathBuf,
pub url: Option<String>,
pub user: String,
pub version: String,
}
Expand Down Expand Up @@ -163,20 +162,21 @@ impl InstallFaucetServiceCtxBuilder {
pub struct AddFaucetServiceOptions {
pub bootstrap_peers: Vec<Multiaddr>,
pub env_variables: Option<Vec<(String, String)>>,
pub faucet_download_bin_path: PathBuf,
pub faucet_install_bin_path: PathBuf,
pub faucet_src_bin_path: PathBuf,
pub local: bool,
pub service_data_dir_path: PathBuf,
pub service_log_dir_path: PathBuf,
pub url: Option<String>,
pub user: String,
pub version: String,
}

pub struct AddDaemonServiceOptions {
pub address: Ipv4Addr,
pub port: u16,
pub daemon_download_bin_path: PathBuf,
pub env_variables: Option<Vec<(String, String)>>,
pub daemon_install_bin_path: PathBuf,
pub daemon_src_bin_path: PathBuf,
pub port: u16,
pub user: String,
pub version: String,
}
Loading

0 comments on commit 951b167

Please sign in to comment.