Skip to content

Commit

Permalink
Merge pull request #84 from regolith-labs/hardhat/v2
Browse files Browse the repository at this point in the history
Merge v2 branch into master
  • Loading branch information
HardhatChad authored Jul 8, 2024
2 parents 0e4bf1e + 12f7d56 commit 5ef4812
Show file tree
Hide file tree
Showing 16 changed files with 265 additions and 244 deletions.
178 changes: 127 additions & 51 deletions Cargo.lock

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

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ path = "src/main.rs"
[features]
default = []
admin = []
gpu = ["drillx/gpu"]
# gpu = ["drillx/gpu"]

[dependencies]
bincode = "1.3.3"
Expand All @@ -21,10 +21,12 @@ bytemuck = "1.15.0"
cached = "0.46.1"
chrono = "0.4.38"
clap = { version = "4.4.12", features = ["derive"] }
drillx = { path = "../drillx/drillx", optional = false }
colored = "2.0"
drillx = { git = "https://github.com/regolith-labs/drillx", branch = "master", features = ["solana"] }
futures = "0.3.30"
num_cpus = "1.16.0"
ore = { path = "../ore", package = "ore-program" }
ore-api = { git = "https://github.com/regolith-labs/ore", rev = "ce9a701" }
ore-utils = { git = "https://github.com/regolith-labs/ore", rev = "ce9a701" }
rand = "0.8.4"
solana-cli-config = "^1.18"
solana-client = "^1.18"
Expand Down
34 changes: 8 additions & 26 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,22 @@ pub struct ClaimArgs {
#[derive(Parser, Debug)]
pub struct CloseArgs {}

#[cfg(feature = "admin")]
#[derive(Parser, Debug)]
pub struct PauseArgs {}

#[cfg(feature = "admin")]
#[derive(Parser, Debug)]
pub struct InitializeArgs {}

#[cfg(not(feature = "gpu"))]
#[derive(Parser, Debug)]
pub struct MineArgs {
// #[cfg(not(feature = "gpu"))]
#[arg(
long,
short,
value_name = "THREAD_COUNT",
help = "The number of threads to dedicate to mining",
help = "The number of CPU threads to allocate to mining",
default_value = "1"
)]
pub threads: u64,
Expand All @@ -65,30 +69,8 @@ pub struct MineArgs {
long,
short,
value_name = "SECONDS",
help = "The number seconds before liveness penalty deadline to stop mining and start submitting",
default_value = "10"
)]
pub buffer_time: u64,
}

#[cfg(feature = "gpu")]
#[derive(Parser, Debug)]
pub struct MineArgs {
#[arg(
long,
short,
value_name = "kHZ",
help = "The clock rate of your gpu device",
default_value = "1800000"
)]
pub clockrate: u64,

#[arg(
long,
short,
value_name = "SECONDS",
help = "The number seconds before liveness penalty deadline to stop mining and start submitting",
default_value = "10"
help = "The number seconds before the deadline to stop mining and start submitting",
default_value = "5"
)]
pub buffer_time: u64,
}
Expand Down
2 changes: 1 addition & 1 deletion src/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Miner {
let proof = get_proof(&self.rpc_client, address).await;
let token_account_address = spl_associated_token_account::get_associated_token_address(
&address,
&ore::MINT_ADDRESS,
&ore_api::consts::MINT_ADDRESS,
);
let token_balance = if let Ok(Some(token_account)) = self
.rpc_client
Expand Down
6 changes: 5 additions & 1 deletion src/busses.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use ore::{state::Bus, utils::AccountDeserialize, BUS_ADDRESSES, TOKEN_DECIMALS};
use ore_api::{
consts::{BUS_ADDRESSES, TOKEN_DECIMALS},
state::Bus,
};
use ore_utils::AccountDeserialize;

use crate::Miner;

Expand Down
Loading

0 comments on commit 5ef4812

Please sign in to comment.