Skip to content

Commit

Permalink
added k < 32 option
Browse files Browse the repository at this point in the history
  • Loading branch information
madMAx43v3r committed Aug 22, 2021
1 parent 3435f07 commit f44713e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/chia_plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ std::vector<uint8_t> bech32_address_decode(const std::string& addr)
}

inline
phase4::output_t create_plot( const int num_threads,
phase4::output_t create_plot( const int k,
const int num_threads,
const int log_num_buckets,
const int log_num_buckets_3,
const vector<uint8_t>& pool_key_bytes,
Expand Down Expand Up @@ -154,6 +155,7 @@ phase4::output_t create_plot( const int num_threads,
}

phase1::input_t params;
params.k = k;
{
vector<uint8_t> bytes = have_puzzle ? puzzle_hash_bytes : pool_key.Serialize();
{
Expand All @@ -162,7 +164,7 @@ phase4::output_t create_plot( const int num_threads,
}
bls::Util::Hash256(params.id.data(), bytes.data(), bytes.size());
}
const std::string plot_name = "plot-k32-" + get_date_string_ex("%Y-%m-%d-%H-%M")
const std::string plot_name = "plot-k" + std::to_string(k) + "-" + get_date_string_ex("%Y-%m-%d-%H-%M")
+ "-" + bls::Util::HexStr(params.id.data(), params.id.size());

std::cout << "Working Directory: " << (tmp_dir.empty() ? "$PWD" : tmp_dir) << std::endl;
Expand Down Expand Up @@ -225,6 +227,7 @@ int main(int argc, char** argv)
std::string tmp_dir;
std::string tmp_dir2;
std::string final_dir;
int k = 32;
int num_plots = 1;
int num_threads = 4;
int num_buckets = 256;
Expand All @@ -233,6 +236,7 @@ int main(int argc, char** argv)
bool tmptoggle = false;

options.allow_unrecognised_options().add_options()(
"k, size", "K size (default = 32, k <= 32)", cxxopts::value<int>(k))(
"n, count", "Number of plots to create (default = 1, -1 = infinite)", cxxopts::value<int>(num_plots))(
"r, threads", "Number of threads (default = 4)", cxxopts::value<int>(num_threads))(
"u, buckets", "Number of buckets (default = 256)", cxxopts::value<int>(num_buckets))(
Expand Down Expand Up @@ -451,7 +455,7 @@ int main(int argc, char** argv)
}
std::cout << "Crafting plot " << i+1 << " out of " << num_plots << std::endl;
const auto out = create_plot(
num_threads, log_num_buckets, log_num_buckets_3,
k, num_threads, log_num_buckets, log_num_buckets_3,
pool_key, puzzle_hash, farmer_key, tmp_dir, tmp_dir2);

if(final_dir != tmp_dir)
Expand Down

0 comments on commit f44713e

Please sign in to comment.