fireice-uk / xmr-stak-cpu

Monero CPU miner
GNU General Public License v3.0
1.11k stars 478 forks source link

[feature] start xmr-stak-cpu binary with parameters instead of configfile #391

Open sheepchen opened 7 years ago

sheepchen commented 7 years ago

Hi, I am working on rolling out the xmr-stak-cpu system (windows and linux) in my data center. I have master-server who triggers the start of the miner via WMI/SSH. Is there a way to start the miner without a config-file. Instead with parameters?

Like: ./xmr-stat-cpu --CPU 2,3,4,5,6 --pool-addr "pool.supportxmr.com:5555" --wallet-addr "WesXUZRGAGCXLU [..]" --pool_pass "miner-$hostname" --verbose 4

If not, this should be a feature. Its not hard to program, but it makes the software way more dynamic.

And while we're at features: there should be a switch that dumps out the H/s every x minutes. So I can get rid of the whole verbose and only see the H/s. (--verbose 0 --showHash 2)

fogoat commented 6 years ago

In the mean time, if you can SSH into the server, you can easily scp a config.txt riight?

And while we're at features: there should be a switch that dumps out the H/s every x minutes.

Configure an output log file in config.txt

tail -f xmr.log | grep -i highest -B 5

Output will look like this:

HASHRATE REPORT
| ID | 2.5s |  60s |  15m |
|  0 | 74.2 | 73.6 | 72.9 |
---------------------------
Totals:   74.2 73.6 72.9 H/s
Highest:  75.6 H/s
HASHRATE REPORT
| ID | 2.5s |  60s |  15m |
|  0 | 72.2 | 72.4 | 72.9 |
---------------------------
Totals:   72.2 72.4 72.9 H/s
Highest:  75.6 H/s
--
HASHRATE REPORT
| ID | 2.5s |  60s |  15m |
|  0 | 74.4 | 73.3 | 72.9 |
---------------------------
Totals:   74.4 73.3 72.9 H/s
Highest:  75.6 H/s
sheepchen commented 6 years ago

Yes I can SSH to my linux servers and I can copy via smb to the windows server. But this is overheat that can lead to failures. The better way were plain parameters. Also so you need only one binary in the hole network were every system can point to. Thats way smoother for large environments like my little farm.

And the tail shows me the last values from the logfile. this is not the same as results every x minutes. I even cant say if the values that i see are up-to-date or just from an log file where the mainprogram is crashed or just not running.

This solutions are okay if you have 1-2 servers where you ssh into and want to look. But if you have many servers in an topology structure this leads to more problems than good.

fogoat commented 6 years ago

And the tail shows me the last values from the logfile. this is not the same as results every x minutes.

Please try it before you dismiss it. I don't think you really understand how tail works with grep in my example.

sheepchen commented 6 years ago

I work as AIX and linux expert for 10 years. I know excatly what this commands do. The idea that you had is not bad. In fact my systems works like that for some weeks now. The problem is that you have to write a wrapper to your binary that deletes the logfile after runtime or crash. If not it can happen that you see old entries. Also you have to carry 2 more files to your binary. My systems work on diffrent loads over the day. So I have to create a configfile for every scenario that i want to trigger. This all is way overhead for the CnC-server for controlling big environments. Also the hashrate reporting just works in verbose level 4. This means the log-file will be very big at long runtimes.

The better way were if you can call the binary from the CnC with parameters. Then you don't have all the trouble above. And from the programming standpiunt its just parsing the *args[] instast of reading (and interpreting) an configfile.