Skip to content

Commit

Permalink
Merge pull request #5 from GalactechsLLC/add-payout-address-and-plot-…
Browse files Browse the repository at this point in the history
…directory-init-args

Add `payout-address` and `plot-directory` init arguments
  • Loading branch information
DaOneLuna authored Nov 12, 2023
2 parents caf8e5f + 8560c7a commit 2852000
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::farmer::config::{Config, FarmingInfo, PoolWalletConfig};
use crate::farmer::config::{BladebitHarvesterConfig, Config, FarmingInfo, PoolWalletConfig};
use clap::{Parser, Subcommand};
use dg_xch_cli::wallets::plotnft_utils::scrounge_for_plotnfts;
use dg_xch_clients::rpc::full_node::FullnodeClient;
Expand Down Expand Up @@ -44,6 +44,10 @@ pub enum Action {
fullnode_ssl: Option<String>,
#[arg(short = 'n', long)]
network: Option<String>,
#[arg(short = 'a', long)]
payout_address: Option<String>,
#[arg(short = 'd', long = "plot-directory")]
plot_directories: Option<Vec<String>>,
},
}
impl Default for Action {
Expand All @@ -61,6 +65,8 @@ pub struct GenerateConfig<'a> {
pub fullnode_rpc_port: Option<u16>,
pub fullnode_ssl: Option<String>,
pub network: Option<String>,
pub payout_address: Option<String>,
pub plot_directories: Option<Vec<String>>,
pub additional_headers: Option<HashMap<String, String>>,
}

Expand Down Expand Up @@ -97,6 +103,10 @@ pub async fn generate_config_from_mnemonic(
})
.unwrap_or("mainnet".to_string());
config.selected_network = network;
config.payout_address = gen_settings.payout_address.unwrap_or_default();
config.harvester_configs.bladebit = Some(BladebitHarvesterConfig {
plot_directories: gen_settings.plot_directories.unwrap_or_default(),
});
let master_key = key_from_mnemonic(gen_settings.mnemonic)?;
config.fullnode_ws_host = gen_settings
.fullnode_ws_host
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ async fn main() -> Result<(), Error> {
fullnode_rpc_port,
fullnode_ssl,
network,
payout_address,
plot_directories,
} => {
SimpleLogger::new()
.with_colors(true)
Expand All @@ -183,6 +185,8 @@ async fn main() -> Result<(), Error> {
fullnode_rpc_port,
fullnode_ssl,
network,
payout_address,
plot_directories,
additional_headers: None,
})
.await?;
Expand Down

0 comments on commit 2852000

Please sign in to comment.