forked from PascalCoinDev/PascalCoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPascalCoinMiner.pp
538 lines (500 loc) · 19.1 KB
/
PascalCoinMiner.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
program PascalCoinMiner;
{$mode objfpc}{$H+}
{$DEFINE UseCThreads}
{$I ./Units/PascalCoin/config.inc}
{ Copyright (c) 2017 by Albert Molina
Distributed under the MIT software license, see the accompanying file LICENSE
or visit http://www.opensource.org/licenses/mit-license.php.
This unit is a part of Pascal Coin, a P2P crypto currency without need of
historical operations.
If you like it, consider a donation using BitCoin:
16K3HCZRhFUtM8GdWRcfKeaa6KsuyxZaYk
}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, SysUtils, CustApp, crt, SyncObjs,
UBlockChain, UPoolMinerThreads, UGPUMining,
UPoolMining, ULog, UThread, UAccounts, UCrypto,
UConst, UTime, UJSONFunctions, UNode, UNetProtocol, USha256,
UOpenSSL,
DelphiCL;
type
{ TPascalMinerApp }
TPascalMinerApp = class(TCustomApplication)
FLastLogs : TStringList;
procedure ShowGPUDrivers;
procedure OnConnectionStateChanged(Sender : TObject);
procedure OnDeviceStateChanged(Sender : TObject);
procedure OnMinerValuesChanged(Sender : TObject);
procedure OnFoundNOnce(Sender : TCustomMinerDeviceThread; Timestamp, nOnce : Cardinal);
procedure WriteLine(nline : Integer; txt : String);
procedure OnInThreadNewLog(logtype : TLogType; Time : TDateTime; ThreadID : Cardinal; Const sender, logtext : AnsiString);
protected
FWindow32X1,FWindow32Y1,FWindow32X2,FWindow32Y2: DWord;
FLock : TCriticalSection;
FPrivateKey : TECPrivateKey;
FPoolMinerThread : TPoolMinerThread;
FDeviceThreads : TList;
FAppStartTime : TDateTime;
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
Const
CT_MINER_VERSION = {$IFDEF PRODUCTION}'0.5'{$ELSE}{$IFDEF TESTNET}'0.5 TESTNET'{$ELSE}ERROR{$ENDIF}{$ENDIF};
CT_Line_DeviceStatus = 3;
CT_Line_ConnectionStatus = 4;
CT_Line_MinerValues = 7;
CT_Line_MiningStatus = 10;
CT_Line_LastFound = 12;
CT_Line_Logs = 15;
CT_MaxLogs = 10;
CT_OpenCL_FileName = 'pascalsha.cl';
{ TPascalMinerApp }
procedure TPascalMinerApp.ShowGPUDrivers;
Var i,j,n : Integer;
dev : TDCLDevice;
begin
n := 0;
If Not TGPUDriver.GPUDriver.HasOpenCL then WriteLn('No GPU driver found')
else begin
Writeln('');
WriteLn('** Platforms (Total ',TGPUDriver.GPUDriver.Platforms.PlatformCount,')');
for i:=0 to TGPUDriver.GPUDriver.Platforms.PlatformCount-1 do begin
WriteLn('Platform ',i,' Name:',Trim(TGPUDriver.GPUDriver.Platforms.Platforms[i]^.Name),
' Version:',Trim(TGPUDriver.GPUDriver.Platforms.Platforms[i]^.Version),
' Vendor:',Trim(TGPUDriver.GPUDriver.Platforms.Platforms[i]^.Vendor),
' CPU''s:',TGPUDriver.GPUDriver.Platforms.Platforms[i]^.CPUCount,
' GPU''s:',TGPUDriver.GPUDriver.Platforms.Platforms[i]^.GPUCount,
' Devices: ',TGPUDriver.GPUDriver.Platforms.Platforms[i]^.DeviceCount
);
inc(n,TGPUDriver.GPUDriver.Platforms.Platforms[i]^.DeviceCount);
end;
Writeln('');
Writeln('** Platforms and devices available: (Total ',n,')');
for i:=0 to TGPUDriver.GPUDriver.Platforms.PlatformCount-1 do begin
for j:=0 to TGPUDriver.GPUDriver.Platforms.Platforms[i]^.DeviceCount-1 do begin
dev := TGPUDriver.GPUDriver.Platforms.Platforms[i]^.Devices[j]^;
Writeln('-p ',i,' -d ',j,' Name:',Trim(dev.Name),' Compute Units:',dev.MaxComputeUnits,' Max Freq.:',dev.MaxClockFrequency);
end;
end;
end;
end;
procedure TPascalMinerApp.OnConnectionStateChanged(Sender: TObject);
Const CT_state : Array[boolean] of String = ('Disconnected','Connected');
var i : Integer;
s : String;
begin
If FPoolMinerThread.PoolMinerClient.PoolType=ptNone then s:='MINING'
else s:='POOL MINING USER "'+FPoolMinerThread.PoolMinerClient.UserName+'"';
If FPoolMinerThread.PoolMinerClient.Connected then begin
WriteLine(CT_Line_ConnectionStatus,s + ' server: '+FPoolMinerThread.PoolMinerClient.ClientRemoteAddr);
For i:=0 to FDeviceThreads.Count-1 do begin
TCustomMinerDeviceThread(FDeviceThreads[i]).Paused:=false;
end;
end else begin
For i:=0 to FDeviceThreads.Count-1 do begin
TCustomMinerDeviceThread(FDeviceThreads[i]).Paused:=true;
end;
WriteLine(CT_Line_ConnectionStatus,'** NOT CONNECTED '+s + ' Connecting to '+FPoolMinerThread.PoolMinerClient.ClientRemoteAddr);
end;
end;
procedure TPascalMinerApp.OnDeviceStateChanged(Sender: TObject);
Var i : Integer;
s : String;
begin
If Sender is TCustomMinerDeviceThread then begin
If TCustomMinerDeviceThread(Sender).IsMining then WriteLine(CT_Line_DeviceStatus,'') // clear line
else WriteLine(CT_Line_DeviceStatus,'*** Not mining ***');
end;
end;
procedure TPascalMinerApp.OnMinerValuesChanged(Sender: TObject);
begin
If Sender is TCustomMinerDeviceThread then begin
If TCustomMinerDeviceThread(Sender).MinerValuesForWork.block>0 then begin
WriteLine(CT_Line_MinerValues,Format('Current block: %d Wallet Name: "%s" Target: %s',
[TCustomMinerDeviceThread(Sender).MinerValuesForWork.block,
FPoolMinerThread.GlobalMinerValuesForWork.payload_start,
IntToHex(TCustomMinerDeviceThread(Sender).MinerValuesForWork.target,8)
]));
end;
end;
end;
procedure TPascalMinerApp.OnFoundNOnce(Sender: TCustomMinerDeviceThread; Timestamp, nOnce: Cardinal);
begin
WriteLine(CT_Line_LastFound + FDeviceThreads.Count,FormatDateTime('hh:nn:ss',now)+' Block:'+IntToStr(Sender.MinerValuesForWork.block)+' NOnce:'+Inttostr(nOnce)+
' Timestamp:'+inttostr(Timestamp)+' Miner:'+Sender.MinerValuesForWork.payload_start);
end;
procedure TPascalMinerApp.WriteLine(nline: Integer; txt: String);
Var i : Integer;
begin
FLock.Acquire;
try
i := length(txt);
if i<=(FWindow32X2-FWindow32X1+1) then begin
setlength(txt,FWindow32X2-FWindow32X1+1);
fillchar(txt[i+1],FWindow32X2-FWindow32X1+1-i,' ');
end else begin
txt := copy(txt,1,FWindow32X2-FWindow32X1+1);
end;
if (nline<=(FWindow32Y2-FWindow32Y1)) then begin
GotoXY32(FWindow32X1,nline);
write(txt);
end;
finally
FLock.Release;
end;
end;
procedure TPascalMinerApp.OnInThreadNewLog(logtype: TLogType; Time: TDateTime;
ThreadID: Cardinal; const sender, logtext: AnsiString);
var msg : String;
i,nline : Integer;
begin
If logtype=ltdebug then exit;
FLock.Acquire;
try
msg := formatdatetime('hh:nn:ss',now)+' '+CT_LogType[logtype]+' '+logtext;
// TODO - test logtype is properly casted/stored/retrieved/accessed.
// Confirm casting doesn't lose bits in 32/64 bit archs
// OLD: FLastLogs.AddObject(msg,TObject(PtrInt(logtype)));
FLastLogs.AddObject(msg,TObject(Int(QWord(logtype))));
i := FLastLogs.Count-CT_MaxLogs;
if (i<0) then i:=0;
nline := CT_Line_Logs+FDeviceThreads.Count;
while (i<FLastLogs.Count) do begin
WriteLine(nline,FLastLogs[i]);
inc(nline); inc(i);
end;
if FLastLogs.Count>(CT_MaxLogs*2) then begin
for i:=1 to CT_MaxLogs do FLastLogs.Delete(0);
end;
Finally
FLock.Release;
end;
end;
procedure TPascalMinerApp.DoRun;
var
ErrorMsg: String;
s : String;
nsarr : TNodeServerAddressArray;
Function AddMiners : Boolean;
var p,d,c,i : Integer;
strl : TStringList;
devt : TCustomMinerDeviceThread;
begin
Result := false;
if (Not HasOption('p','platform')) And (Not HasOption('d','device')) And (Not HasOption('c','cpu')) then begin
Writeln('Need to specify -p X and -d Y for GPU mining or -c N for CPU mining. See -h for more info');
ShowGPUDrivers;
Terminate;
Exit;
end;
if HasOption('c','cpu') then begin
c := StrToIntDef(GetOptionValue('c','cpu'),-1);
if (c<=0) or (c>CPUCount) then begin
WriteLn('Invalid cpu value ',c,'. Valid values: 1..',CPUCount);
Terminate;
exit;
end;
devt:= TCPUDeviceThread.Create(FPoolMinerThread,CT_TMinerValuesForWork_NULL);
devt.OnStateChanged:=@OnDeviceStateChanged;
devt.OnMinerValuesChanged:=@OnMinerValuesChanged;
devt.OnFoundNOnce:=@OnFoundNOnce;
TCPUDeviceThread(devt).CPUs:=c;
devt.Paused:=true;
FDeviceThreads.Add(devt);
end else begin
p := StrToIntDef(GetOptionValue('p','platform'),-1);
d := StrToIntDef(GetOptionValue('d','device'),-1);
if (p<0) or (p>=TGPUDriver.GPUDriver.Platforms.PlatformCount) then begin
WriteLn('Invalid Platform ',p,'. Valid values: 0..',TGPUDriver.GPUDriver.Platforms.PlatformCount-1);
Terminate;
exit;
end;
strl := TStringList.Create;
try
if (d<0) then begin
// Is a value separated by commas?
strl.Delimiter:=',';
strl.DelimitedText:=GetOptionValue('d','device');
end else strl.Text:=inttostr(d);
for i:=0 to strl.Count-1 do begin
d := StrToIntDef(strl[i],-1);
if (d<0) or (d>=TGPUDriver.GPUDriver.Platforms.Platforms[p]^.DeviceCount) then begin
WriteLn('Invalid device ',d,'. Valid values: 0..',TGPUDriver.GPUDriver.Platforms.Platforms[p]^.DeviceCount-1);
Terminate;
exit;
end;
//
devt := TGPUDeviceThread.Create(FPoolMinerThread,CT_TMinerValuesForWork_NULL);
devt.OnStateChanged:=@OnDeviceStateChanged;
devt.OnMinerValuesChanged:=@OnMinerValuesChanged;
devt.OnFoundNOnce:=@OnFoundNOnce;
TGPUDeviceThread(devt).Platform:=p;
TGPUDeviceThread(devt).Device:=d;
TGPUDeviceThread(devt).ProgramFileName:=ExtractFileDir(ExeName)+PathDelim+CT_OpenCL_FileName;
devt.Paused:=true;
FDeviceThreads.Add(devt);
end;
finally
strl.Free;
end;
end;
Result := true;
end;
Procedure DoWaitAndLog;
Var tc : Cardinal;
gs,ms : TMinerStats;
hrReal,hrHashing, glhrHashing, glhrReal : Real;
i : Integer;
devt : TCustomMinerDeviceThread;
s : String;
Begin
tc := GetTickCount64;
repeat
If FPoolMinerThread.PoolMinerClient.Connected then begin
for i:=0 to FDeviceThreads.Count-1 do begin
TCustomMinerDeviceThread(FDeviceThreads[i]).Paused:=false;
end;
end;
while (Not Terminated) do begin
sleep(100);
//devt := TCustomMinerDeviceThread(FDeviceThreads[0]);
If (tc + 1000)<GetTickCount64 then begin
tc := GetTickCount64;
//ms := devt.DeviceStats;
For i:=0 to FDeviceThreads.Count-1 do begin
devt := TCustomMinerDeviceThread(FDeviceThreads[i]);
ms := devt.DeviceStats;
if ms.WorkingMillisecondsHashing>0 then hrHashing := (((ms.RoundsCount DIV Int64(ms.WorkingMillisecondsHashing)))/(1000))
else hrHashing := 0;
gs := devt.GlobalDeviceStats;
If ms.RoundsCount>0 then begin
s := FormatDateTime('hh:nn:ss',now)+Format(' Miner:"%s" at %0.2f MH/s - Rounds: %0.2f G Found: %d',[devt.MinerValuesForWork.payload_start,hrHashing, gs.RoundsCount/1000000000, gs.WinsCount]);
If (gs.Invalids>0) then s := s +' '+inttostr(gs.Invalids)+' ERRORS!';
WriteLine(CT_Line_MiningStatus+i,s);
end else begin
If gs.RoundsCount>0 then begin
s := FormatDateTime('hh:nn:ss',now)+Format(' Miner:"%s" **NOT MINING** - Rounds: %0.2f G Found: %d',[devt.MinerValuesForWork.payload_start,gs.RoundsCount/1000000000, gs.WinsCount]);
If (gs.Invalids>0) then s := s +' '+inttostr(gs.Invalids)+' ERRORS!';
end else begin
s := FormatDateTime('hh:nn:ss',now)+' Not mining...';
end;
WriteLine(CT_Line_MiningStatus+i,s);
end;
end;
WriteLine(CT_Line_LastFound+FDeviceThreads.Count-1,'MY VALID BLOCKS FOUND: '+IntToStr(gs.WinsCount) +' Working time: '+IntToStr(Trunc(now - FAppStartTime))+'d '+FormatDateTime('hh:nn:ss',Now-FAppStartTime) );
end;
If KeyPressed then begin
If ReadKey in ['c','C','q','Q'] then begin
WriteLine(CT_Line_Logs+FDeviceThreads.Count+CT_MaxLogs,'Finalizing...');
terminate;
end;
end;
end;
until Terminated;
end;
Procedure DoVisualprocess(minerName, UserName, Password : String);
Var sc : tcrtcoord;
Flog : TLog;
devt : TCustomMinerDeviceThread;
i : Integer;
Begin
FPoolMinerThread := TPoolMinerThread.Create(nsarr[0].ip,nsarr[0].port,FPrivateKey.PublicKey);
try
If (UserName<>'') then begin
FPoolMinerThread.PoolMinerClient.PoolType:=ptIdentify;
FPoolMinerThread.PoolMinerClient.UserName:=UserName;
FPoolMinerThread.PoolMinerClient.Password:=Password;
end;
If Not AddMiners then exit;
if HasOption('t','testmode') then begin
i := StrToIntDef(GetOptionValue('t','testmode'),-1);
if (i>=0) And (i<=32) then begin
FPoolMinerThread.TestingPoWLeftBits:=i;
end else begin
WriteLn('Invalid bits for testing mode. value ',i,'. Valid values: 0..32 (0=No testing mode)');
Terminate;
exit;
end;
end;
//
cursoroff;
try
clrscr;
FWindow32X1:=WindMinX;
FWindow32X2:=WindMaxX;
FWindow32Y1:=WindMinY;
FWindow32Y2:=WindMaxY;
WriteLine(1,'** PascalCoin miner ** Version: '+CT_MINER_VERSION);
WriteLine(CT_Line_MinerValues-1,'MINER VALUES:');
WriteLine(CT_Line_MiningStatus-1,'MINING STATUS:');
WriteLine(CT_Line_LastFound+FDeviceThreads.Count-1,'MY VALID BLOCKS FOUND: 0');
WriteLine(CT_Line_Logs+FDeviceThreads.Count-1,'LOGS:');
FPoolMinerThread.MinerAddName:=minerName;
WriteLine(CT_Line_MinerValues-1,'MINER VALUES: (My miner name="'+minerName+'")');
FPoolMinerThread.OnConnectionStateChanged:=@OnConnectionStateChanged;
OnConnectionStateChanged(FPoolMinerThread);
If (FDeviceThreads.Count)=1 then begin
devt := TCustomMinerDeviceThread(FDeviceThreads[0]);
WriteLine(2,devt.MinerDeviceName);
end else begin
WriteLine(2,'Mining using '+IntToStr(FDeviceThreads.Count)+' devices');
end;
Flog := TLog.Create(Nil);
try
Flog.OnInThreadNewLog:=@OnInThreadNewLog;
DoWaitAndLog;
finally
FLog.free;
end;
finally
cursoron;
end;
Finally
FPoolMinerThread.Terminate;
FPoolMinerThread.Free;
end;
end;
Var username,password : String;
begin
FLastLogs := TStringList.Create;
FLock := TCriticalSection.Create;
Try
// quick check parameters
ErrorMsg:=CheckOptions('hp:d:s::c:n::t:u::x::', 'help platform device server cpu minername testmode user pwd');
if ErrorMsg<>'' then begin
//ShowException(Exception.Create(ErrorMsg));
WriteLn(ErrorMsg);
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Exit;
end;
if (Not HasOption('p','platform')) And (Not HasOption('d','device')) And (Not HasOption('c','cpu:')) then begin
Writeln('Need to specify -p X and -d Y for GPU mining or -c N for CPU mining');
Writeln('Execute ',ExtractFileName(ExeName),' -h for more info');
ShowGPUDrivers;
Exit;
end;
If Not FileExists(ExtractFileDir(ExeName)+PathDelim+CT_OpenCL_FileName) then begin
Writeln('**********************');
Writeln('OpenCL file not found!');
Writeln('File: ',CT_OpenCL_FileName);
Exit;
end;
If HasOption('s','server') then begin
s := Trim(GetOptionValue('s','server'));
if (s='') then s := 'localhost:'+inttostr(CT_JSONRPCMinerServer_Port);
end else s:='';
if (s='') then begin
WriteLn('Input server name (default is localhost:',CT_JSONRPCMinerServer_Port,'):');
Readln(s);
trim(s);
if (s='') then s := 'localhost:'+inttostr(CT_JSONRPCMinerServer_Port);
end;
if (pos(':',s)=0) then begin
s := trim(s) + ':'+inttostr(CT_JSONRPCMinerServer_Port);
end;
TNode.DecodeIpStringToNodeServerAddressArray(s,nsarr);
if (length(nsarr)<>1) then begin
Writeln('INVALID SERVER VALUE ',s);
WriteHelp;
Exit;
end;
If (Not HasOption('n','minername')) then begin
WriteLn('Input miner name that will be added to server miner name:');
Readln(s);
end else s:=GetOptionValue('n','minername');
Try
TCrypto.InitCrypto;
Except
On E:Exception do begin
Writeln('**************************');
Writeln('Error initializing library '+SSL_C_LIB+' (Not found or not valid)');
Writeln('Error message: '+E.Message);
Writeln('**************************');
Exit;
end;
end;
username:='';
password:='';
If (HasOption('u','user')) Or (HasOption('x','pwd')) then begin
username:=trim(GetOptionValue('u','user'));
password:=trim(GetOptionValue('x','pwd'));
if (username='') then begin
WriteLn('Input Pool username (or empty for non pool connection):');
Readln(username);
end;
if (password='') And (username<>'') then begin
WriteLn('Input Pool password for user ',username,':');
Readln(password);
end;
end;
FPrivateKey := TECPrivateKey.Create;
Try
FPrivateKey.GenerateRandomPrivateKey(CT_Default_EC_OpenSSL_NID);
DoVisualprocess(s,username,password);
finally
FreeAndNil(FPrivateKey);
end;
finally
FreeAndNil(FLock);
FreeAndNil(FLastLogs);
if not terminated then
Terminate;
end;
end;
constructor TPascalMinerApp.Create(TheOwner: TComponent);
Var FLog : TLog;
begin
inherited Create(TheOwner);
FDeviceThreads := TList.Create;
StopOnException:=True;
FAppStartTime := Now;
FLog := TLog.Create(self);
FLog.SaveTypes:=CT_TLogTypes_DEFAULT;
FLog.FileName:=ExtractFileDir(ExeName)+PathDelim+'PascalCoinMiner.log';
end;
destructor TPascalMinerApp.Destroy;
begin
FreeAndNil(FDeviceThreads);
inherited Destroy;
end;
procedure TPascalMinerApp.WriteHelp;
begin
{ add your help code here }
writeln('PascalCoin Miner - Version: ',CT_MINER_VERSION);
writeln('Usage: ', ExtractFileName(ExeName), ' -h -s S -p X -d Y -c N -n MYNAME');
writeln(' -h for help');
writeln(' -s S (S is PascalCoin server:port where default value is localhost:',CT_JSONRPCMinerServer_Port,')');
writeln(' -p X (X is GPU platform)');
writeln(' -d Y (Y is GPU device for platform)');
writeln(' Y can be multiple devices. Example -d 0,2,3 Will use devices 0, 2 and 3');
writeln(' -c N (For CPU mining, where N is CPU''s to use. Activating this disable GPU mining)');
writeln(' -n MYNAME (Will add MYNAME value to miner name assigned by server)');
writeln(' ** POOL IDENTIFICATION PROTOCOL **');
writeln(' (Not needed for PascalCoin core, only some third party pools)');
writeln(' -u USERNAME');
writeln(' -x PASSWORD');
writeln('');
writeln('Basic example GPU mining over multiple devices: ');
writeln(' ',ExtractFileName(ExeName),' -p 0 -d 0,1,2,3 -s -n ABC');
writeln(' (Devices 0,1,2,3 at server localhost:',CT_JSONRPCMinerServer_Port,' miner name ABC)');
writeln('');
ShowGPUDrivers;
end;
var
Application: TPascalMinerApp;
begin
Application:=TPascalMinerApp.Create(nil);
Application.Title:='Pascal Miner';
Application.Run;
Application.Free;
end.