2023-03-20 01:10:44 +01:00
|
|
|
|
2023-05-26 13:02:14 +02:00
|
|
|
#ifndef MINING_API_H
|
|
|
|
#define MINING_API_H
|
|
|
|
|
2023-03-20 01:10:44 +01:00
|
|
|
// Mining
|
2023-08-05 21:32:37 +02:00
|
|
|
#define MAX_NONCE_STEP 5000000U
|
|
|
|
#define MAX_NONCE 25000000U
|
2023-05-07 13:21:00 +02:00
|
|
|
#define TARGET_NONCE 471136297U
|
2023-07-23 00:26:19 +02:00
|
|
|
#define DEFAULT_DIFFICULTY 1e-4
|
2023-06-07 14:12:45 +02:00
|
|
|
#define KEEPALIVE_TIME_ms 30000
|
|
|
|
#define POOLINACTIVITY_TIME_ms 60000
|
2023-05-26 13:02:14 +02:00
|
|
|
|
|
|
|
#define TARGET_BUFFER_SIZE 64
|
2023-05-03 21:11:59 +02:00
|
|
|
|
|
|
|
void runMonitor(void *name);
|
2023-05-26 13:02:14 +02:00
|
|
|
void runStratumWorker(void *name);
|
|
|
|
void runMiner(void *name);
|
|
|
|
String printLocalTime(void);
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
uint8_t bytearray_target[32];
|
|
|
|
uint8_t bytearray_pooltarget[32];
|
|
|
|
uint8_t merkle_result[32];
|
|
|
|
uint8_t bytearray_blockheader[80];
|
2023-07-23 00:26:19 +02:00
|
|
|
uint8_t bytearray_blockheader2[80];
|
2023-07-20 12:50:35 +02:00
|
|
|
double poolDifficulty;
|
2023-05-26 13:02:14 +02:00
|
|
|
bool inRun;
|
|
|
|
bool newJob;
|
2023-06-08 10:21:16 +02:00
|
|
|
bool newJob2;
|
2023-05-26 13:02:14 +02:00
|
|
|
}miner_data;
|
|
|
|
|
|
|
|
|
|
|
|
#endif // UTILS_API_H
|