feat(c-miner): port miner pipeline to modular C implementation
This commit is contained in:
30
miner.h
Normal file
30
miner.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef MINER_H
|
||||
#define MINER_H
|
||||
|
||||
#include <stdatomic.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef void (*mine_status_cb)(long long attempts, double hashrate_hz, void *ctx);
|
||||
|
||||
typedef struct {
|
||||
int found;
|
||||
uint32_t nonce;
|
||||
double hashrate_hz;
|
||||
long long attempts;
|
||||
uint8_t header[80];
|
||||
uint8_t digest[32];
|
||||
} MineResult;
|
||||
|
||||
int mine_block(
|
||||
uint8_t header_76[76],
|
||||
const char *target_hex,
|
||||
const char *nonce_mode,
|
||||
uint32_t batch_size,
|
||||
int timestamp_update_interval,
|
||||
atomic_int *stop_flag,
|
||||
mine_status_cb status_cb,
|
||||
void *status_ctx,
|
||||
MineResult *out
|
||||
);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user