Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/madMAx43v3r/chia-plotter
Browse files Browse the repository at this point in the history
…into windows-fury-road
  • Loading branch information
stotiks committed Jul 23, 2021
2 parents 82f92a9 + 974d6e5 commit 055a5db
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
14 changes: 10 additions & 4 deletions README.md
Expand Up @@ -6,16 +6,20 @@ similar to how GPUs work, only the "cores" are normal software CPU threads.
As a result this plotter is able to fully max out any storage device's bandwidth,
simply by increasing the number of "cores", ie. threads.

Sponsored by [Flexpool.io](https://www.flexpool.io/) - Check them out if you're looking for a secure and scalable Chia pool.

## Usage

Join the Discord for support: https://discord.gg/YJ4GSMMY
Join the Discord for support: https://discord.gg/pQwkebKnPB

```
For <poolkey> and <farmerkey> see output of `chia keys show`.
To plot for pools, specify <contract> address via -c instead of <poolkey>, see `chia plotnft show`.
<tmpdir> needs about 220 GiB space, it will handle about 25% of all writes. (Examples: './', '/mnt/tmp/')
<tmpdir2> needs about 110 GiB space and ideally is a RAM drive, it will handle about 75% of all writes.
Combined (tmpdir + tmpdir2) peak disk usage is less than 256 GiB.
In case of <count> != 1, you may press Ctrl-C for graceful termination after current plot is finished or double Ctrl-c to terminate immediatelly\
In case of <count> != 1, you may press Ctrl-C for graceful termination after current plot is finished,
or double press Ctrl-C to terminate immediately.
Usage:
chia_plot [OPTION...]
Expand All @@ -29,9 +33,10 @@ Usage:
-d, --finaldir arg Final directory (default = <tmpdir>)
-w, --waitforcopy Wait for copy to start next plot
-p, --poolkey arg Pool Public Key (48 bytes)
-c, --contract arg Pool Contract Address (64 chars)
-c, --contract arg Pool Contract Address (62 chars)
-f, --farmerkey arg Farmer Public Key (48 bytes)
-G, --tmptoggle Alternate tmpdir/tmpdir2 (default = false)
-K, --rmulti2 arg Thread multiplier for P2 (default = 1)
--help Print help
```

Expand All @@ -52,7 +57,7 @@ Note: 128 GiB System RAM minimum required for RAM disk.

XCH: xch1w5c2vv5ak08pczeph7tp5xmkl5762pdf3pyjkg9z4ks4ed55j3psgay0zh

ETH: 0x97057cdf529867838d2a1f7f23ba62456764e0cd
ETH-ERC20: 0x97057cdf529867838d2a1f7f23ba62456764e0cd

LTC: MNUnszsX2srv5EJpu9YYHAXb19MqUpuBjD

Expand Down Expand Up @@ -132,6 +137,7 @@ cd chia-plotter
git checkout master
git pull
git submodule update --init
./make_devel.sh
```

## Future Plans
Expand Down
4 changes: 2 additions & 2 deletions include/chia/phase2.hpp
Expand Up @@ -40,7 +40,7 @@ void compute_table( int R_index, int num_threads,
L_used->set(entry.pos);
L_used->set(uint64_t(entry.pos) + entry.off);
}
}, nullptr, num_threads, "phase2/mark");
}, nullptr, num_threads * g_thread_multi, "phase2/mark");

L_used->clear();
R_input.read(&pool, num_threads_read);
Expand Down Expand Up @@ -101,7 +101,7 @@ void compute_table( int R_index, int num_threads,
tmp.off = pos_off.second;
out.push_back(tmp);
}
}, &R_count, num_threads, "phase2/remap");
}, &R_count, num_threads * g_thread_multi, "phase2/remap");

R_input.read(&map_pool, num_threads_read);

Expand Down
4 changes: 4 additions & 0 deletions include/chia/settings.h
Expand Up @@ -24,5 +24,9 @@ extern size_t g_read_chunk_size;
*/
extern size_t g_write_chunk_size;

namespace phase2 {
extern int g_thread_multi;
}


#endif /* INCLUDE_CHIA_SETTINGS_H_ */
18 changes: 8 additions & 10 deletions src/chia_plot.cpp
Expand Up @@ -61,9 +61,6 @@ std::vector<uint8_t> bech32_address_decode(const std::string& addr)
if(res.encoding != bech32::Bech32m) {
throw std::logic_error("invalid contract address (!Bech32m): " + addr);
}
if(res.hrp != "xch" && res.hrp != "txch") {
throw std::logic_error("invalid contract address (" + res.hrp + " != xch): " + addr);
}
if(res.dp.size() != 52) {
throw std::logic_error("invalid contract address (size != 52): " + addr);
}
Expand Down Expand Up @@ -207,22 +204,22 @@ int _main(int argc, char** argv)
{
std::cout << "Multi-threaded pipelined Chia k32 plotter";
#ifdef GIT_COMMIT_HASH
std::cout << " - " << GIT_COMMIT_HASH;
std::cout << " - " << GIT_COMMIT_HASH << std::endl;
#endif

#ifdef CHIA_PLOT_BUILD_INFO
std::cout << std::endl << CHIA_PLOT_BUILD_INFO;
std::cout << CHIA_PLOT_BUILD_INFO;
#endif
std::cout << std::endl << std::endl;

cxxopts::Options options("chia_plot",
"For <poolkey> and <farmerkey> see output of `chia keys show`.\n"
"To plot for pools, specify <contract> address instead of <poolkey>, see `chia plotnft show`.\n"
"To plot for pools, specify <contract> address via -c instead of <poolkey>, see `chia plotnft show`.\n"
"<tmpdir> needs about 220 GiB space, it will handle about 25% of all writes. (Examples: './', '/mnt/tmp/')\n"
"<tmpdir2> needs about 110 GiB space and ideally is a RAM drive, it will handle about 75% of all writes.\n"
"Combined (tmpdir + tmpdir2) peak disk usage is less than 256 GiB.\n"
"In case of <count> != 1, you may press Ctrl-C for graceful termination after current plot is finished,\n"
"or double press Ctrl-C to terminate immediately.\n"
"or double press Ctrl-C to terminate immediately.\n\n"
);

std::string pool_key_str;
Expand All @@ -248,9 +245,10 @@ int _main(int argc, char** argv)
"d, finaldir", "Final directory (default = <tmpdir>)", cxxopts::value<std::string>(final_dir))(
"w, waitforcopy", "Wait for copy to start next plot", cxxopts::value<bool>(waitforcopy))(
"p, poolkey", "Pool Public Key (48 bytes)", cxxopts::value<std::string>(pool_key_str))(
"c, contract", "Pool Contract Address (64 chars)", cxxopts::value<std::string>(contract_addr_str))(
"c, contract", "Pool Contract Address (62 chars)", cxxopts::value<std::string>(contract_addr_str))(
"f, farmerkey", "Farmer Public Key (48 bytes)", cxxopts::value<std::string>(farmer_key_str))(
"G, tmptoggle", "Alternate tmpdir/tmpdir2", cxxopts::value<bool>(tmptoggle))(
"K, rmulti2", "Thread multiplier for P2 (default = 1)", cxxopts::value<int>(phase2::g_thread_multi))(
"help", "Print help");

if(argc <= 1) {
Expand Down Expand Up @@ -432,7 +430,7 @@ int _main(int argc, char** argv)

const auto time = (get_wall_time_micros() - total_begin) / 1e6;
if(time > 1) {
std::cout << "Copy to " << from_to.second << " finished, took " << time << " sec, "
std::cout << "Copy to " << from_to.second << " finished, took " << time << " sec, "
<< ((bytes / time) / 1024 / 1024) << " MB/s avg." << std::endl;
} else {
std::cout << "Renamed final plot to " << from_to.second << std::endl;
Expand Down
3 changes: 3 additions & 0 deletions src/settings.cpp
Expand Up @@ -11,3 +11,6 @@
size_t g_read_chunk_size = 65536;
size_t g_write_chunk_size = 4096;

namespace phase2 {
int g_thread_multi = 1;
}

0 comments on commit 055a5db

Please sign in to comment.