diff options
Diffstat (limited to 'main/stratum_proxy.h')
| -rw-r--r-- | main/stratum_proxy.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/main/stratum_proxy.h b/main/stratum_proxy.h new file mode 100644 index 0000000..b940640 --- /dev/null +++ b/main/stratum_proxy.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef STRATUM_PROXY_H | ||
| 2 | #define STRATUM_PROXY_H | ||
| 3 | |||
| 4 | #include "esp_err.h" | ||
| 5 | #include <stdint.h> | ||
| 6 | #include <stdbool.h> | ||
| 7 | |||
| 8 | #define STRATUM_MAX_JOB_ID_LEN 32 | ||
| 9 | #define STRATUM_MAX_JOBS 4 | ||
| 10 | |||
| 11 | typedef struct { | ||
| 12 | uint32_t job_id; | ||
| 13 | uint8_t prevhash[32]; | ||
| 14 | uint8_t merkle_root[32]; | ||
| 15 | uint32_t ntime; | ||
| 16 | uint32_t nbits; | ||
| 17 | uint32_t version; | ||
| 18 | uint8_t target[32]; | ||
| 19 | int target_len; | ||
| 20 | bool valid; | ||
| 21 | } stratum_job_t; | ||
| 22 | |||
| 23 | typedef struct { | ||
| 24 | double hashrate_ghs; | ||
| 25 | uint32_t nbits; | ||
| 26 | uint64_t total_shares; | ||
| 27 | uint64_t total_accepted; | ||
| 28 | uint64_t total_rejected; | ||
| 29 | double current_hashprice; | ||
| 30 | int active_miners; | ||
| 31 | } stratum_proxy_stats_t; | ||
| 32 | |||
| 33 | esp_err_t stratum_proxy_init(uint16_t port); | ||
| 34 | void stratum_proxy_set_job(const stratum_job_t *job); | ||
| 35 | const stratum_job_t *stratum_proxy_get_current_job(void); | ||
| 36 | void stratum_proxy_get_stats(stratum_proxy_stats_t *stats); | ||
| 37 | void stratum_proxy_stop(void); | ||
| 38 | |||
| 39 | #endif | ||