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

23
rpc.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef RPC_H
#define RPC_H
#include <stddef.h>
#include "config.h"
#include "types.h"
typedef struct {
const MinerConfig *cfg;
} RpcClient;
void rpc_init(RpcClient *client, const MinerConfig *cfg);
int rpc_test_connection(RpcClient *client, char **chain_out);
int rpc_get_best_block_hash(RpcClient *client, char **hash_out);
int rpc_get_block_template(RpcClient *client, BlockTemplate *tpl);
int rpc_get_address_script_pubkey(RpcClient *client, const char *wallet_address, char **script_out);
int rpc_get_raw_transaction(RpcClient *client, const char *txid, char **raw_tx_out);
int rpc_ensure_witness_data(RpcClient *client, BlockTemplate *tpl);
int rpc_submit_block(RpcClient *client, const char *serialized_block);
#endif