forked from OCEAN-xyz/datum_gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatum_conf.h
More file actions
134 lines (114 loc) · 3.87 KB
/
datum_conf.h
File metadata and controls
134 lines (114 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
*
* DATUM Gateway
* Decentralized Alternative Templates for Universal Mining
*
* This file is part of OCEAN's Bitcoin mining decentralization
* project, DATUM.
*
* https://ocean.xyz
*
* ---
*
* Copyright (c) 2024 Bitcoin Ocean, LLC & Jason Hughes
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef _DATUM_CONF_H_
#define _DATUM_CONF_H_
#define DATUM_CONFIG_MAX_ARRAY_ENTRIES 32
#define DATUM_MAX_BLOCK_SUBMITS DATUM_CONFIG_MAX_ARRAY_ENTRIES
#define DATUM_CONFIG_MAX_STRING_ARRAY_LEN 1024
#include <stdbool.h>
#include <stdint.h>
#define DATUM_CONF_BOOL 1
#define DATUM_CONF_INT 2
#define DATUM_CONF_STRING 3
#define DATUM_CONF_STRING_ARRAY 4
#define DATUM_CONF_TYPES 5
typedef struct {
char category[32];
char name[64];
char description[512];
int var_type;
int max_string_len;
int default_int;
bool default_bool;
const char *default_string[DATUM_CONFIG_MAX_ARRAY_ENTRIES];
void *ptr;
bool required;
} T_DATUM_CONFIG_ITEM;
// Globally accessable config options
typedef struct {
char bitcoind_rpcuser[128];
char bitcoind_rpcpassword[128];
char bitcoind_rpcurl[256];
int bitcoind_work_update_seconds;
bool bitcoind_notify_fallback;
int stratum_v1_listen_port;
int stratum_v1_max_clients;
int stratum_v1_max_threads;
int stratum_v1_max_clients_per_thread;
int stratum_v1_vardiff_min;
int stratum_v1_vardiff_target_shares_min;
int stratum_v1_vardiff_quickdiff_count;
int stratum_v1_vardiff_quickdiff_delta;
int stratum_v1_share_stale_seconds;
bool stratum_v1_fingerprint_miners;
int stratum_v1_idle_timeout_no_subscribe;
int stratum_v1_idle_timeout_no_share;
int stratum_v1_idle_timeout_max_last_work;
char mining_pool_address[256];
char mining_coinbase_tag_primary[256];
char mining_coinbase_tag_secondary[256];
char mining_save_submitblocks_dir[256];
int coinbase_unique_id;
int api_listen_port;
int extra_block_submissions_count;
char extra_block_submissions_urls[DATUM_MAX_BLOCK_SUBMITS][DATUM_CONFIG_MAX_STRING_ARRAY_LEN];
bool clog_to_file;
bool clog_to_console;
int clog_level_console;
int clog_level_file;
bool clog_calling_function;
bool clog_to_stderr;
bool clog_rotate_daily;
char clog_file[1024];
char datum_pool_host[1024];
int datum_pool_port;
bool datum_pool_pass_workers;
bool datum_pool_pass_full_users;
bool datum_always_pay_self;
bool datum_pooled_mining_only;
char datum_pool_pubkey[1024];
int datum_protocol_global_timeout;
uint64_t datum_protocol_global_timeout_ms;
uint32_t prime_id;
unsigned char override_mining_pool_scriptsig[256];
int override_mining_pool_scriptsig_len;
char override_mining_coinbase_tag_primary[256];
uint64_t override_vardiff_min;
} global_config_t;
extern global_config_t datum_config;
extern char userpass[sizeof(datum_config.bitcoind_rpcuser) + sizeof(datum_config.bitcoind_rpcpassword)];
int datum_read_config(const char *conffile);
void datum_gateway_help(void);
#endif