@@ -188,7 +188,7 @@ class MinerCLI
188
188
if (p + 1 <= userpass.length ())
189
189
m_pass = userpass.substr (p+1 );
190
190
}
191
- else if ((arg == " -SV " || arg == " --stratum-version " ) && i + 1 < argc)
191
+ else if ((arg == " -SC " || arg == " --stratum-client " ) && i + 1 < argc)
192
192
{
193
193
try {
194
194
m_stratumClientVersion = atoi (argv[++i]);
@@ -201,9 +201,27 @@ class MinerCLI
201
201
BOOST_THROW_EXCEPTION (BadArgument ());
202
202
}
203
203
}
204
- else if (arg == " -ES " || arg == " --ethereum- stratum" )
204
+ else if (( arg == " -SP " || arg == " --stratum-protocol " ) && i + 1 < argc )
205
205
{
206
- m_ethereumStratum = true ;
206
+ try {
207
+ m_stratumProtocol = atoi (argv[++i]);
208
+ }
209
+ catch (...)
210
+ {
211
+ cerr << " Bad " << arg << " option: " << argv[i] << endl;
212
+ BOOST_THROW_EXCEPTION (BadArgument ());
213
+ }
214
+ }
215
+ else if ((arg == " -SE" || arg == " --stratum-email" ) && i + 1 < argc)
216
+ {
217
+ try {
218
+ m_email = string (argv[++i]);
219
+ }
220
+ catch (...)
221
+ {
222
+ cerr << " Bad " << arg << " option: " << argv[i] << endl;
223
+ BOOST_THROW_EXCEPTION (BadArgument ());
224
+ }
207
225
}
208
226
else if ((arg == " -FO" || arg == " --failover-userpass" ) && i + 1 < argc)
209
227
{
@@ -400,47 +418,6 @@ class MinerCLI
400
418
{
401
419
m_minerType = MinerType::Mixed;
402
420
}
403
- /*
404
- else if (arg == "--current-block" && i + 1 < argc)
405
- m_currentBlock = stol(argv[++i]);
406
- else if ((arg == "-w" || arg == "--check-pow") && i + 4 < argc)
407
- {
408
- string m;
409
- try
410
- {
411
- Ethash::BlockHeader bi;
412
- m = boost::to_lower_copy(string(argv[++i]));
413
- h256 powHash(m);
414
- m = boost::to_lower_copy(string(argv[++i]));
415
- h256 seedHash;
416
- if (m.size() == 64 || m.size() == 66)
417
- seedHash = h256(m);
418
- else
419
- seedHash = EthashAux::seedHash(stol(m));
420
- m = boost::to_lower_copy(string(argv[++i]));
421
- bi.setDifficulty(u256(m));
422
- auto boundary = bi.boundary();
423
- m = boost::to_lower_copy(string(argv[++i]));
424
- bi.setNonce(h64(m));
425
- auto r = EthashAux::eval(seedHash, powHash, bi.nonce());
426
- bool valid = r.value < boundary;
427
- cout << (valid ? "VALID :-)" : "INVALID :-(") << endl;
428
- cout << r.value << (valid ? " < " : " >= ") << boundary << endl;
429
- cout << " where " << boundary << " = 2^256 / " << bi.difficulty() << endl;
430
- cout << " and " << r.value << " = ethash(" << powHash << ", " << bi.nonce() << ")" << endl;
431
- cout << " with seed as " << seedHash << endl;
432
- if (valid)
433
- cout << "(mixHash = " << r.mixHash << ")" << endl;
434
- cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl;
435
- exit(0);
436
- }
437
- catch (...)
438
- {
439
- cerr << "Bad " << arg << " option: " << m << endl;
440
- BOOST_THROW_EXCEPTION(BadArgument());
441
- }
442
- }
443
- */
444
421
else if (arg == " -M" || arg == " --benchmark" )
445
422
{
446
423
mode = OperationMode::Benchmark;
@@ -603,8 +580,12 @@ class MinerCLI
603
580
<< " -O, --userpass <username.workername:password> Stratum login credentials" << endl
604
581
<< " -FO, --failover-userpass <username.workername:password> Failover stratum login credentials (optional, will use normal credentials when omitted)" << endl
605
582
<< " --work-timeout <n> reconnect/failover after n seconds of working on the same (stratum) job. Defaults to 180. Don't set lower than max. avg. block time" << endl
606
- << " -SV, --stratum-version <n> Stratum client version. Defaults to 1 (async client). Use 2 to test new synchronous client." << endl
607
- << " -ES, --ethereum-stratum Use EthereumStratum/1.0.0 mode." << endl
583
+ << " -SC, --stratum-client <n> Stratum client version. Defaults to 1 (async client). Use 2 to use the new synchronous client." << endl
584
+ << " -SP, --stratum-protocol <n> Choose which stratum protocol to use:" << endl
585
+ << " 0: official stratum spec: ethpool, ethermine, coinotron, mph, nanopool (default)" << endl
586
+ << " 1: eth-proxy compatible: dwarfpool, f2pool, nanopool" << endl
587
+ << " 2: EthereumStratum/1.0.0: nicehash" << endl
588
+ << " -SE, --stratum-email <s> Email address used in eth-proxy (optional)" << endl
608
589
#endif
609
590
#if ETH_JSONRPC || ETH_STRATUM || !ETH_TRUE
610
591
<< " --farm-recheck <n> Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output" << endl
@@ -930,6 +911,7 @@ class MinerCLI
930
911
cwarn << " :-( Not accepted." ;
931
912
f.rejectedSolution (false );
932
913
}
914
+ // exit(0);
933
915
}
934
916
else if (EthashAux::eval (previous.seedHash , previous.headerHash , solution.nonce ).value < previous.boundary )
935
917
{
@@ -942,6 +924,7 @@ class MinerCLI
942
924
cwarn << " :-( Not accepted." ;
943
925
f.rejectedSolution (true );
944
926
}
927
+ // exit(0);
945
928
}
946
929
else {
947
930
f.failedSolution ();
@@ -1005,7 +988,7 @@ class MinerCLI
1005
988
1006
989
// this is very ugly, but if Stratum Client V2 tunrs out to be a success, V1 will be completely removed anyway
1007
990
if (m_stratumClientVersion == 1 ) {
1008
- EthStratumClient client (&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, m_ethereumStratum );
991
+ EthStratumClient client (&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, m_stratumProtocol, m_email );
1009
992
if (m_farmFailOverURL != " " )
1010
993
{
1011
994
if (m_fuser != " " )
@@ -1045,7 +1028,7 @@ class MinerCLI
1045
1028
}
1046
1029
}
1047
1030
else if (m_stratumClientVersion == 2 ) {
1048
- EthStratumClientV2 client (&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, m_ethereumStratum );
1031
+ EthStratumClientV2 client (&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, m_stratumProtocol, m_email );
1049
1032
if (m_farmFailOverURL != " " )
1050
1033
{
1051
1034
if (m_fuser != " " )
@@ -1135,12 +1118,13 @@ class MinerCLI
1135
1118
1136
1119
#if ETH_STRATUM || !ETH_TRUE
1137
1120
int m_stratumClientVersion = 1 ;
1138
- bool m_ethereumStratum = false ;
1121
+ int m_stratumProtocol = STRATUM_PROTOCOL_STRATUM ;
1139
1122
string m_user;
1140
1123
string m_pass;
1141
1124
string m_port;
1142
1125
string m_fuser = " " ;
1143
1126
string m_fpass = " " ;
1127
+ string m_email = " " ;
1144
1128
#endif
1145
1129
string m_fport = " " ;
1146
1130
};
0 commit comments