feat(c-miner): port miner pipeline to modular C implementation

This commit is contained in:
2026-03-30 01:07:19 +02:00
parent 9a0a170799
commit d2c118833b
18 changed files with 3299 additions and 0 deletions

30
miner.h Normal file
View 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