This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 689
/
Copy pathClusterConfig.cs
862 lines (703 loc) · 24.5 KB
/
ClusterConfig.cs
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using AspNetCoreRateLimit;
using JetBrains.Annotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable PropertyCanBeMadeInitOnly.Global
// ReSharper disable InconsistentNaming
namespace Miningcore.Configuration;
#region Coin Definitions
public enum CoinFamily
{
[EnumMember(Value = "bitcoin")]
Bitcoin,
[EnumMember(Value = "equihash")]
Equihash,
[EnumMember(Value = "cryptonote")]
Cryptonote,
[EnumMember(Value = "ethereum")]
Ethereum,
[EnumMember(Value = "ergo")]
Ergo,
}
public abstract partial class CoinTemplate
{
/// <summary>
/// Name
/// </summary>
[JsonProperty(Order = -10)]
public string Name { get; set; }
/// <summary>
/// Canonical Name
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string CanonicalName { get; set; }
/// <summary>
/// Trade Symbol
/// </summary>
[JsonProperty(Order = -9)]
public string Symbol { get; set; }
/// <summary>
/// Website
/// </summary>
[JsonProperty(Order = -9)]
public string Website { get; set; }
/// <summary>
/// Family
/// </summary>
[JsonConverter(typeof(StringEnumConverter), true)]
[JsonProperty(Order = -8)]
public CoinFamily Family { get; set; }
/// <summary>
/// Dictionary mapping block type to a block explorer Url
/// Supported placeholders: $height$ and $hash$
/// </summary>
public Dictionary<string, string> ExplorerBlockLinks { get; set; }
/// <summary>
/// Block explorer URL for transactions
/// Can be alternatively used to define the url for the default Block type
/// Supported placeholders: $height$ and $hash$
/// </summary>
public string ExplorerBlockLink { get; set; }
/// <summary>
/// Block explorer URL for transactions
/// Supported placeholders: {0}
/// </summary>
public string ExplorerTxLink { get; set; }
/// <summary>
/// Block explorer URL for accounts
/// Supported placeholders: {0}
/// </summary>
public string ExplorerAccountLink { get; set; }
/// <summary>
/// Twitter Link
/// </summary>
[JsonProperty(Order = -9)]
public string Twitter { get; set; }
/// <summary>
/// Discord Link
/// </summary>
[JsonProperty(Order = -9)]
public string Discord { get; set; }
/// <summary>
/// Telegram Group Link
/// </summary>
[JsonProperty(Order = -9)]
public string Telegram { get; set; }
/// <summary>
/// Arbitrary extension data
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> Extra { get; set; }
/// <summary>
/// Coin Family associciations
/// </summary>
[JsonIgnore]
public static readonly Dictionary<CoinFamily, Type> Families = new()
{
{CoinFamily.Bitcoin, typeof(BitcoinTemplate)},
{CoinFamily.Equihash, typeof(EquihashCoinTemplate)},
{CoinFamily.Cryptonote, typeof(CryptonoteCoinTemplate)},
{CoinFamily.Ethereum, typeof(EthereumCoinTemplate)},
{CoinFamily.Ergo, typeof(ErgoCoinTemplate)},
};
}
public enum BitcoinSubfamily
{
[EnumMember(Value = "none")]
None,
//[EnumMember(Value = "florincoin")]
//Florincoin,
}
public partial class BitcoinTemplate : CoinTemplate
{
public class BitcoinNetworkParams
{
/// <summary>
/// Arbitrary extension data
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> Extra { get; set; }
}
[JsonProperty(Order = -7, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(BitcoinSubfamily.None)]
[JsonConverter(typeof(StringEnumConverter), true)]
public BitcoinSubfamily Subfamily { get; set; }
public JObject CoinbaseHasher { get; set; }
public JObject HeaderHasher { get; set; }
public JObject BlockHasher { get; set; }
[JsonProperty("posBlockHasher")]
public JObject PoSBlockHasher { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(1u)]
public uint CoinbaseTxVersion { get; set; }
/// <summary>
/// Default transaction comment for coins that REQUIRE tx comments
/// </summary>
public string CoinbaseTxComment { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasPayee { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasMasterNodes { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool HasFounderFee { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(1.0d)]
public double ShareMultiplier { get; set; } = 1.0d;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool CoinbaseIgnoreAuxFlags { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool IsPseudoPoS { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public JToken BlockTemplateRpcExtraParams { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, BitcoinNetworkParams> Networks { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public int? CoinbaseMinConfimations { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string BlockSerializer { get; set; }
}
public enum EquihashSubfamily
{
[EnumMember(Value = "none")]
None,
}
public partial class EquihashCoinTemplate : CoinTemplate
{
public partial class EquihashNetworkParams
{
public string Diff1 { get; set; }
public int SolutionSize { get; set; } = 1344;
public int SolutionPreambleSize { get; set; } = 3;
public JObject Solver { get; set; }
public string CoinbaseTxNetwork { get; set; }
public bool PayFoundersReward { get; set; }
public bool PayFundingStream { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public decimal PercentFoundersReward { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string[] FoundersRewardAddresses { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ulong FoundersRewardSubsidySlowStartInterval { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ulong FoundersRewardSubsidyHalvingInterval { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public decimal PercentTreasuryReward { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ulong TreasuryRewardStartBlockHeight { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string[] TreasuryRewardAddresses { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public double TreasuryRewardAddressChangeInterval { get; set; }
// ZCash "Overwinter"
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? OverwinterActivationHeight { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? OverwinterTxVersion { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? OverwinterTxVersionGroupId { get; set; }
// ZCash "Sapling"
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? SaplingActivationHeight { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? SaplingTxVersion { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public uint? SaplingTxVersionGroupId { get; set; }
}
[JsonProperty(Order = -7, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(EquihashSubfamily.None)]
[JsonConverter(typeof(StringEnumConverter), true)]
public EquihashSubfamily Subfamily { get; set; }
public Dictionary<string, EquihashNetworkParams> Networks { get; set; }
public bool UsesZCashAddressFormat { get; set; } = true;
/// <summary>
/// Force use of BitcoinPayoutHandler instead of EquihashPayoutHandler
/// </summary>
public bool UseBitcoinPayoutHandler { get; set; }
}
public enum CryptonoteSubfamily
{
[EnumMember(Value = "none")]
None,
}
public enum CryptonightHashType
{
[EnumMember(Value = "randomx")]
RandomX,
}
public partial class CryptonoteCoinTemplate : CoinTemplate
{
[JsonProperty(Order = -7, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(CryptonoteSubfamily.None)]
[JsonConverter(typeof(StringEnumConverter), true)]
public CryptonoteSubfamily Subfamily { get; set; }
/// <summary>
/// Broader Cryptonight hash family
/// </summary>
[JsonConverter(typeof(StringEnumConverter), true)]
[JsonProperty(Order = -5)]
public CryptonightHashType Hash { get; set; }
/// <summary>
/// Set to 0 for automatic selection from blobtemplate
/// </summary>
[JsonProperty(Order = -4, DefaultValueHandling = DefaultValueHandling.Include)]
public int HashVariant { get; set; }
/// <summary>
/// Smallest unit for Blockreward formatting
/// </summary>
public decimal SmallestUnit { get; set; }
/// <summary>
/// Prefix of a valid address
/// See: namespace config -> CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefix { get; set; }
/// <summary>
/// Prefix of a valid testnet-address
/// See: namespace config -> CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefixTestnet { get; set; }
/// <summary>
/// Prefix of a valid stagenet-address
/// See: namespace config -> CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefixStagenet { get; set; }
/// <summary>
/// Prefix of a valid integrated address
/// See: namespace testnet -> CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefixIntegrated { get; set; }
/// <summary>
/// Prefix of a valid integrated stagenet-address
/// See: namespace testnet -> CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefixIntegratedStagenet { get; set; }
/// <summary>
/// Prefix of a valid integrated testnet-address
/// See: namespace testnet -> CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX in src/cryptonote_config.h
/// </summary>
public ulong AddressPrefixIntegratedTestnet { get; set; }
/// <summary>
/// Fraction of block reward, the pool really gets to keep
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(1.0d)]
public decimal BlockrewardMultiplier { get; set; }
}
public enum EthereumSubfamily
{
[EnumMember(Value = "none")]
None,
}
public partial class EthereumCoinTemplate : CoinTemplate
{
[JsonProperty(Order = -7, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue(EthereumSubfamily.None)]
[JsonConverter(typeof(StringEnumConverter), true)]
public EthereumSubfamily Subfamily { get; set; }
}
public partial class ErgoCoinTemplate : CoinTemplate
{
}
#endregion // Coin Definitions
public enum PayoutScheme
{
PPLNS = 1,
PROP = 2,
SOLO = 3,
PPS = 4,
PPBS = 5,
}
[UsedImplicitly]
public partial class ClusterLoggingConfig
{
public string Level { get; set; }
public bool EnableConsoleLog { get; set; }
public bool EnableConsoleColors { get; set; }
public string LogFile { get; set; }
public string ApiLogFile { get; set; }
public bool PerPoolLogFile { get; set; }
public string LogBaseDirectory { get; set; }
}
public partial class NetworkEndpointConfig
{
public string Host { get; set; }
public int Port { get; set; }
}
public partial class AuthenticatedNetworkEndpointConfig : NetworkEndpointConfig
{
public string User { get; set; }
public string Password { get; set; }
}
public class DaemonEndpointConfig : AuthenticatedNetworkEndpointConfig
{
/// <summary>
/// Use SSL to for RPC requests
/// </summary>
public bool Ssl { get; set; }
/// <summary>
/// Use HTTP2 protocol for RPC requests (don't use this unless your daemon(s) live behind a HTTP reverse proxy)
/// </summary>
public bool Http2 { get; set; }
/// <summary>
/// Optional endpoint category
/// </summary>
public string Category { get; set; }
/// <summary>
/// Optional request path for RPC requests
/// </summary>
public string HttpPath { get; set; }
/// <summary>
/// Arbitrary extension data
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> Extra { get; set; }
}
[UsedImplicitly]
public class DatabaseConfig : AuthenticatedNetworkEndpointConfig
{
public string Database { get; set; }
}
[UsedImplicitly]
public class TcpProxyProtocolConfig
{
/// <summary>
/// Enable for client IP addresses to be detected when using a load balancer with TCP proxy protocol enabled, such as HAProxy.
/// </summary>
public bool Enable { get; set; }
/// <summary>
/// Terminate connections that are not beginning with a proxy-protocol header
/// </summary>
public bool Mandatory { get; set; }
/// <summary>
/// List of IP addresses of valid proxy addresses. If absent, localhost is used
/// </summary>
public string[] ProxyAddresses { get; set; }
}
[UsedImplicitly]
public class PoolEndpoint
{
public string ListenAddress { get; set; }
public string Name { get; set; }
public double Difficulty { get; set; }
public TcpProxyProtocolConfig TcpProxyProtocol { get; set; }
public VarDiffConfig VarDiff { get; set; }
/// <summary>
/// Enable Transport layer security (TLS)
/// If set to true, you must specify values for either TlsPemFile or TlsPfxFile
/// If TlsPemFile does not include the private key, TlsKeyFile is also required
/// </summary>
public bool Tls { get; set; }
/// <summary>
/// Enable TLS sniffing
/// Check incoming stratum connections for TLS handshake indicator and default to non-TLS if not present
/// </summary>
public bool TlsAuto { get; set; }
/// <summary>
/// PKCS certificate file
/// </summary>
public string TlsPfxFile { get; set; }
/// <summary>
/// Certificate file password
/// </summary>
public string TlsPfxPassword { get; set; }
}
[UsedImplicitly]
public partial class VarDiffConfig
{
/// <summary>
/// Minimum difficulty
/// </summary>
public double MinDiff { get; set; }
/// <summary>
/// Network difficulty will be used if it is lower than this
/// </summary>
public double? MaxDiff { get; set; }
/// <summary>
/// Do not alter difficulty by more than this during a single retarget in either direction
/// </summary>
public double? MaxDelta { get; set; }
/// <summary>
/// Try to get 1 share per this many seconds
/// </summary>
public double TargetTime { get; set; }
/// <summary>
/// Check to see if we should retarget every this many seconds
/// </summary>
public double RetargetTime { get; set; }
/// <summary>
/// Allow submission frequency to diverge this much (%) from target time without triggering a retarget
/// </summary>
public double VariancePercent { get; set; }
}
public enum BanManagerKind
{
Integrated = 1,
IpTables
}
[UsedImplicitly]
public class ClusterBanningConfig
{
public BanManagerKind? Manager { get; set; }
/// <summary>
/// Ban clients sending non-json or invalid json
/// </summary>
public bool? BanOnJunkReceive { get; set; }
/// <summary>
/// Ban miners for crossing invalid share threshold
/// </summary>
public bool? BanOnInvalidShares { get; set; }
}
[UsedImplicitly]
public partial class PoolShareBasedBanningConfig
{
public bool Enabled { get; set; }
public int CheckThreshold { get; set; } // Check stats when this many shares have been submitted
public double InvalidPercent { get; set; } // What percent of invalid shares triggers ban
public int Time { get; set; } // How many seconds to ban worker for
}
[UsedImplicitly]
public partial class PoolPaymentProcessingConfig
{
public bool Enabled { get; set; }
public decimal MinimumPayment { get; set; } // in pool-base-currency (ie. Bitcoin, not Satoshis)
public PayoutScheme PayoutScheme { get; set; }
public JToken PayoutSchemeConfig { get; set; }
/// <summary>
/// Arbitrary extension data
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> Extra { get; set; }
}
[UsedImplicitly]
public partial class ClusterPaymentProcessingConfig
{
public bool Enabled { get; set; }
public int Interval { get; set; }
/// <summary>
/// Indentifier used in coinbase transactions to identify the pool
/// </summary>
public string CoinbaseString { get; set; }
}
[UsedImplicitly]
public partial class PersistenceConfig
{
public DatabaseConfig Postgres { get; set; }
}
public class RewardRecipient
{
public string Address { get; set; }
public decimal Percentage { get; set; }
/// <summary>
/// Optional recipient type
/// </summary>
public string Type { get; set; }
}
[UsedImplicitly]
public partial class EmailSenderConfig : AuthenticatedNetworkEndpointConfig
{
public string FromAddress { get; set; }
public string FromName { get; set; }
}
[UsedImplicitly]
public class PushoverConfig
{
public bool Enabled { get; set; }
public string User { get; set; }
public string Token { get; set; }
}
[UsedImplicitly]
public partial class AdminNotifications
{
public bool Enabled { get; set; }
public string EmailAddress { get; set; }
public bool NotifyBlockFound { get; set; }
public bool NotifyPaymentSuccess { get; set; }
}
[UsedImplicitly]
public partial class NotificationsConfig
{
public bool Enabled { get; set; }
public EmailSenderConfig Email { get; set; }
public PushoverConfig Pushover { get; set; }
public AdminNotifications Admin { get; set; }
}
[UsedImplicitly]
public class ApiRateLimitConfig
{
public bool Disabled { get; set; }
public RateLimitRule[] Rules { get; set; }
public string[] IpWhitelist { get; set; }
}
[UsedImplicitly]
public class ApiTlsConfig
{
public bool Enabled { get; set; }
public string TlsPfxFile { get; set; }
public string TlsPfxPassword { get; set; }
}
[UsedImplicitly]
public partial class ApiConfig
{
public bool Enabled { get; set; }
public string ListenAddress { get; set; }
public int Port { get; set; }
public ApiTlsConfig Tls { get; set; }
public ApiRateLimitConfig RateLimiting { get; set; }
/// <summary>
/// Port for admin-apis
/// </summary>
public int? AdminPort { get; set; }
/// <summary>
/// Port for prometheus compatible metrics endpoint /metrics
/// </summary>
public int? MetricsPort { get; set; }
/// <summary>
/// Restricts access to the admin API to these IP addresses
/// If this list null or empty, the default is 127.0.0.1
/// </summary>
public string[] AdminIpWhitelist { get; set; }
/// <summary>
/// Restricts access to the /metrics endpoint to these IP addresses
/// If this list null or empty, the default is 127.0.0.1
/// </summary>
public string[] MetricsIpWhitelist { get; set; }
}
[UsedImplicitly]
public class ZmqPubSubEndpointConfig
{
public string Url { get; set; }
public string Topic { get; set; }
// Curve Transport Layer Security Encryption key shared by client and server
public string SharedEncryptionKey { get; set; }
}
[UsedImplicitly]
public class ShareRelayEndpointConfig
{
public string Url { get; set; }
/// <summary>
/// Curve Transport Layer Security Encryption key shared by client and server
/// </summary>
public string SharedEncryptionKey { get; set; }
}
[UsedImplicitly]
public class ShareRelayConfig
{
public string PublishUrl { get; set; }
/// <summary>
/// If set to true, the relay will "Connect" to the url, rather than "Bind" it
/// </summary>
public bool Connect { get; set; }
// Curve Transport Layer Security Encryption key shared by client and server
public string SharedEncryptionKey { get; set; }
}
[UsedImplicitly]
public class Statistics
{
/// <summary>
/// Statistics update interval in seconds
/// </summary>
public int? UpdateInterval { get; set; }
/// <summary>
/// Time window of shares to take into account when calculating - in minutes
/// </summary>
public int? HashrateCalculationWindow { get; set; }
/// <summary>
/// Stats cleanup interval in hours
/// </summary>
public int? GcInterval { get; set; }
/// <summary>
/// Time window in days of stats to discard when cleaning up periodically
/// </summary>
public int? CleanupDays { get; set; }
}
[UsedImplicitly]
public class NicehashClusterConfig
{
/// <summary>
/// If set to true, the Nicehash service will be started
/// </summary>
public bool EnableAutoDiff { get; set; }
}
[UsedImplicitly]
public partial class PoolConfig
{
/// <summary>
/// unique id
/// </summary>
[Required]
public string Id { get; set; }
/// <summary>
/// Coin template reference
/// </summary>
[Required]
public string Coin { get; set; }
public bool Enabled { get; set; }
[Required]
public Dictionary<int, PoolEndpoint> Ports { get; set; }
[Required]
public DaemonEndpointConfig[] Daemons { get; set; }
public PoolPaymentProcessingConfig PaymentProcessing { get; set; }
public PoolShareBasedBanningConfig Banning { get; set; }
public RewardRecipient[] RewardRecipients { get; set; }
public string Address { get; set; }
public string PubKey { get; set; } // POS coins only
public int ClientConnectionTimeout { get; set; }
public int JobRebroadcastTimeout { get; set; }
public int BlockRefreshInterval { get; set; }
/// <summary>
/// If true, internal stratum ports are not initialized
/// </summary>
public bool? EnableInternalStratum { get; set; }
/// <summary>
/// Arbitrary extension data
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> Extra { get; set; }
}
[UsedImplicitly]
public partial class ClusterConfig
{
/// <summary>
/// cluster instance id (only used in clustering setups)
/// </summary>
public byte? InstanceId { get; set; }
/// <summary>
/// One or more files containing coin definitions
/// </summary>
public string[] CoinTemplates { get; set; }
public string ClusterName { get; set; }
public ClusterLoggingConfig Logging { get; set; }
public ClusterBanningConfig Banning { get; set; }
public PersistenceConfig Persistence { get; set; }
public ClusterPaymentProcessingConfig PaymentProcessing { get; set; }
public NotificationsConfig Notifications { get; set; }
public ApiConfig Api { get; set; }
public Statistics Statistics { get; set; }
public NicehashClusterConfig Nicehash { get; set; }
/// <summary>
/// If this is enabled, shares are not written to the database
/// but published on the specified ZeroMQ Url and using the
/// poolid as topic
/// </summary>
public ShareRelayConfig ShareRelay { get; set; }
/// <summary>
/// External relays to monitor for shares (see option above)
/// </summary>
public ShareRelayEndpointConfig[] ShareRelays { get; set; }
/// <summary>
/// Maximum parallelism of Equihash solver
/// Increasing this value by one, increases pool peak memory consumption by 1 GB
/// </summary>
public int? EquihashMaxThreads { get; set; }
/// <summary>
/// Cryptonight maximum parallelism
/// </summary>
public int? CryptonightMaxThreads { get; set; }
public string ShareRecoveryFile { get; set; }
[Required]
public PoolConfig[] Pools { get; set; }
}