-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathOASISDNA.cs
More file actions
972 lines (857 loc) · 45 KB
/
OASISDNA.cs
File metadata and controls
972 lines (857 loc) · 45 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
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
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
using System;
using System.Collections.Generic;
using NextGenSoftware.ErrorHandling;
using NextGenSoftware.Logging;
using NextGenSoftware.OASIS.API.Core.Configuration;
namespace NextGenSoftware.OASIS.API.DNA
{
public class OASISDNA
{
public OASIS OASIS { get; set; }
}
public class AdminConfig
{
public string AdminEmail { get; set; }
public string AdminUsername { get; set; }
public string AdminPassword { get; set; }
public string AdminFirstName { get; set; }
public string AdminLastName { get; set; }
}
public class OASIS
{
//public string CurrentLiveVersion { get; set; }
//public string CurrentStagingVersion { get; set; }
//public string OASISVersion { get; set; }
public string Terms { get; set; }
public LoggingSettings Logging { get; set; }
public ErrorHandlingSettings ErrorHandling { get; set; }
public SecuritySettings Security { get; set; }
public EmailSettings Email { get; set; }
public StorageProviderSettings StorageProviders { get; set; }
public OASISHyperDriveConfig OASISHyperDriveConfig { get; set; }
// HyperDrive mode switch: "Legacy" or "OASISHyperDrive2"
public string HyperDriveMode { get; set; } = "Legacy";
// Enhanced HyperDrive Configuration
public ReplicationRulesConfig ReplicationRules { get; set; } = new ReplicationRulesConfig();
public FailoverRulesConfig FailoverRules { get; set; } = new FailoverRulesConfig();
public SubscriptionConfig SubscriptionConfig { get; set; } = new SubscriptionConfig();
public DataPermissionsConfig DataPermissions { get; set; } = new DataPermissionsConfig();
public IntelligentModeConfig IntelligentMode { get; set; } = new IntelligentModeConfig();
public string OASISSystemAccountId { get; set; }
public string OASISAPIURL { get; set; }
public string NetworkId { get; set; } = "onet-network";
public Guid SettingsLookupHolonId { get; set; } = Guid.Empty;
// Stats caching controls
public bool StatsCacheEnabled { get; set; } = false;
public int StatsCacheTtlSeconds { get; set; } = 45;
public List<AdminConfig> Admins { get; set; } = new List<AdminConfig>();
}
public class SecuritySettings
{
public bool HideVerificationToken { get; set; }
public bool HideRefreshTokens { get; set; }
public string SecretKey { get; set; }
public int RemoveOldRefreshTokensAfterXDays { set; get; }
public EncryptionSettings AvatarPassword { get; set; }
public EncryptionSettings OASISProviderPrivateKeys { get; set; }
}
public class ErrorHandlingSettings
{
public bool ShowStackTrace { get; set; }
public bool ThrowExceptionsOnErrors { get; set; }
public bool ThrowExceptionsOnWarnings { get; set; }
public bool LogAllErrors { get; set; }
public bool LogAllWarnings { get; set; }
/// <summary>
/// An enum that specifies what to do when an error occurs. The options are: `AlwaysThrowExceptionOnError`, `OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent` & `NeverThrowExceptions`). The default is `OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent` meaning it will only throw an error if the `OnError` event has not been subscribed to. This delegates error handling to the caller. If no event has been subscribed then OASIS will throw an error. `AlwaysThrowExceptionOnError` will always throw an error even if the `OnError` event has been subscribed to. The `NeverThrowException` enum option will never throw an error even if the `OnError` event has not been subscribed to. Regardless of what enum is selected, the error will always be logged using whatever ILogProvider's have been injected into the constructor or set on the static Logging.LogProviders property.
/// </summary>
//public ErrorHandlingBehaviour ErrorHandlingBehaviour { get; set; } = ErrorHandlingBehaviour.OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent;
/// <summary>
/// An enum that specifies what to do when an warning occurs. The options are: `AlwaysThrowExceptionOnWarning`, `OnlyThrowExceptionIfNoWarningHandlerSubscribedToOnWarningEvent` & `NeverThrowExceptions`). The default is `OnlyThrowExceptionIfNoWarningHandlerSubscribedToOnWarningEvent` meaning it will only throw an error if the `OnWarning` event has not been subscribed to. This delegates error handling to the caller. If no event has been subscribed then OASIS will throw an error. `AlwaysThrowExceptionOnWarning` will always throw an error even if the `OnWarning` event has been subscribed to. The `NeverThrowException` enum option will never throw an error even if the `OnWarning` event has not been subscribed to. Regardless of what enum is selected, the error will always be logged using whatever ILogProvider`s have been injected into the constructor or set on the static Logging.LogProviders property.
/// </summary>
//public WarningHandlingBehaviour WarningHandlingBehaviour { get; set; } = WarningHandlingBehaviour.OnlyThrowExceptionIfNoWarningHandlerSubscribedToOnWarningEvent;
/// <summary>
/// An enum that specifies what to do when an error occurs. The options are: `AlwaysThrowExceptionOnError`, `OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent` & `NeverThrowExceptions`). The default is `OnlyThrowExceptionIfNoErrorHandlerSubscribedToOnErrorEvent` meaning it will only throw an error if the `OnError` event has not been subscribed to. This delegates error handling to the caller. If no event has been subscribed then OASIS will throw an error. `AlwaysThrowExceptionOnError` will always throw an error even if the `OnError` event has been subscribed to. The `NeverThrowException` enum option will never throw an error even if the `OnError` event has not been subscribed to. Regardless of what enum is selected, the error will always be logged using whatever ILogProvider's have been injected into the constructor or set on the static Logging.LogProviders property.
/// </summary>
public ErrorHandlingBehaviour ErrorHandlingBehaviour
{
get
{
return ErrorHandling.ErrorHandling.ErrorHandlingBehaviour;
}
set
{
ErrorHandling.ErrorHandling.ErrorHandlingBehaviour = value;
}
}
/// <summary>
/// An enum that specifies what to do when an warning occurs. The options are: `AlwaysThrowExceptionOnWarning`, `OnlyThrowExceptionIfNoWarningHandlerSubscribedToOnWarningEvent` & `NeverThrowExceptions`). The default is `OnlyThrowExceptionIfNoWarningHandlerSubscribedToOnWarningEvent` meaning it will only throw an error if the `OnWarning` event has not been subscribed to. This delegates error handling to the caller. If no event has been subscribed then OASIS will throw an error. `AlwaysThrowExceptionOnWarning` will always throw an error even if the `OnWarning` event has been subscribed to. The `NeverThrowException` enum option will never throw an error even if the `OnWarning` event has not been subscribed to. Regardless of what enum is selected, the error will always be logged using whatever ILogProvider`s have been injected into the constructor or set on the static Logging.LogProviders property.
/// </summary>
public WarningHandlingBehaviour WarningHandlingBehaviour
{
get
{
return ErrorHandling.ErrorHandling.WarningHandlingBehaviour;
}
set
{
ErrorHandling.ErrorHandling.WarningHandlingBehaviour = value;
}
}
}
public class LoggingSettings
{
public string LoggingFramework { get; set; } = "Default";
/// <summary>
/// If the LoggingFramework is set to anything other than 'Default' then you can set this flag to true to also log to the Default LogProvider below.
/// </summary>
public bool AlsoUseDefaultLogProvider { get; set; } = false;
/// <summary>
/// This passes through to the static LogConfig.FileLoggingMode property in [NextGenSoftware.Logging](https://www.nuget.org/packages/NextGenSoftware.Logging) package. It can be either `WarningsErrorsInfoAndDebug`, `WarningsErrorsAndInfo`, `WarningsAndErrors` or `ErrorsOnly`.
/// </summary>
public LoggingMode FileLoggingMode
{
get
{
return LogConfig.FileLoggingMode;
}
set
{
LogConfig.FileLoggingMode = value;
}
}
/// <summary>
/// This passes through to the static LogConfig.ConsoleLoggingMode property in [NextGenSoftware.Logging](https://www.nuget.org/packages/NextGenSoftware.Logging) package. It can be either `WarningsErrorsInfoAndDebug`, `WarningsErrorsAndInfo`, `WarningsAndErrors` or `ErrorsOnly`.
/// </summary>
public LoggingMode ConsoleLoggingMode
{
get
{
return LogConfig.ConsoleLoggingMode;
}
set
{
LogConfig.ConsoleLoggingMode = value;
}
}
/// <summary>
/// Set this to true (default) if you wish HoloNET to log to the console. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public bool LogToConsole { get; set; } = true;
/// <summary>
/// Set this to true to enable coloured logs in the console. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public bool ShowColouredLogs { get; set; } = true;
/// <summary>
/// The colour to use for `Debug` log entries to the console NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public ConsoleColor DebugColour { get; set; } = ConsoleColor.White;
/// <summary>
/// The colour to use for `Info` log entries to the console. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public ConsoleColor InfoColour { get; set; } = ConsoleColor.Green;
/// <summary>
/// The colour to use for `Warning` log entries to the console. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public ConsoleColor WarningColour { get; set; } = ConsoleColor.Yellow;
/// <summary>
/// The colour to use for `Error` log entries to the console. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public ConsoleColor ErrorColour { get; set; } = ConsoleColor.Red;
/// <summary>
/// Set this to true (default) if you wish HoloNET to log a log file. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public bool LogToFile { get; set; } = true;
/// <summary>
/// The logging path (will defualt to AppData\Roaming\NextGenSoftware\OASIS\Logs). NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public string LogPath { get; set; } = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\NextGenSoftware\\OASIS\\Logs";
/// <summary>
/// The log file name (default is OASIS.log). NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public string LogFileName { get; set; } = "OASIS.log";
/// <summary>
/// This is the max file size the log file can be (in bytes) before it creates a new file. The default is 1000000 bytes (1 MB).
/// </summary>
public int MaxLogFileSize { get; set; } = 1000000;
/// <summary>
/// The number of attempts to attempt to log to the file if the first attempt fails. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public int NumberOfRetriesToLogToFile { get; set; } = 3;
/// <summary>
/// The amount of time to wait in seconds between each attempt to log to the file. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public int RetryLoggingToFileEverySeconds { get; set; } = 1;
/// <summary>
/// Set this to true to add additional space after the end of each log entry. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public bool InsertExtraNewLineAfterLogMessage { get; set; } = false;
/// <summary>
/// The amount of space to indent the log message by. NOTE: This is only relevant if the built-in DefaultLogger is used.
/// </summary>
public int IndentLogMessagesBy { get; set; } = 1;
}
public class EncryptionSettings
{
public bool BCryptEncryptionEnabled { get; set; }
public bool Rijndael256EncryptionEnabled { get; set; }
public string Rijndael256Key { get; set; }
public bool QuantumEncryptionEnabled { get; set; }
}
public class StorageProviderSettings
{
public int ProviderMethodCallTimeOutSeconds { get; set; } = 10;
public int ActivateProviderTimeOutSeconds { get; set; } = 10;
public int DectivateProviderTimeOutSeconds { get; set; } = 10;
public bool AutoReplicationEnabled { get; set; }
public bool AutoFailOverEnabled { get; set; }
//public bool AutoFailOverEnabledForAvatarLogin { get; set; }
//public bool AutoFailOverEnabledForCheckIfEmailAlreadyInUse { get; set; }
//public bool AutoFailOverEnabledForCheckIfUsernameAlreadyInUse { get; set; }
public bool AutoLoadBalanceEnabled { get; set; }
public int AutoLoadBalanceReadPollIntervalMins { get; set; }
public int AutoLoadBalanceWritePollIntervalMins { get; set; }
public string AutoReplicationProviders { get; set; }
public string AutoLoadBalanceProviders { get; set; }
public string AutoFailOverProviders { get; set; }
public string AutoFailOverProvidersForAvatarLogin { get; set; }
public string AutoFailOverProvidersForCheckIfEmailAlreadyInUse { get; set; }
public string AutoFailOverProvidersForCheckIfUsernameAlreadyInUse { get; set; }
public string AutoFailOverProvidersForCheckIfOASISSystemAccountExists { get; set; }
public string OASISProviderBootType { get; set; }
public AzureOASISProviderSettings AzureCosmosDBOASIS { get; set; }
public HoloOASISProviderSettings HoloOASIS { get; set; }
public MongoDBOASISProviderSettings MongoDBOASIS { get; set; }
public EOSIOASISProviderSettings EOSIOOASIS { get; set; }
public TelosOASISProviderSettings TelosOASIS { get; set; }
public SEEDSOASISProviderSettings SEEDSOASIS { get; set; }
public ThreeFoldOASISProviderSettings ThreeFoldOASIS { get; set; }
public EthereumOASISProviderSettings EthereumOASIS { get; set; }
public ArbitrumOASISProviderSettings ArbitrumOASIS { get; set; }
public RootstockOASISProviderSettings RootstockOASIS { get; set; }
public PolygonOASISProviderSettings PolygonOASIS { get; set; }
public SQLLiteDBOASISSettings SQLLiteDBOASIS { get; set; }
public IPFSOASISSettings IPFSOASIS { get; set; }
public Neo4jOASISSettings Neo4jOASIS { get; set; }
public SolanaOASISSettings SolanaOASIS { get; set; }
public CargoOASISSettings CargoOASIS { get; set; }
public LocalFileOASISSettings LocalFileOASIS { get; set; }
public PinataOASISSettings PinataOASIS { get; set; }
// Missing Blockchain Providers
public BitcoinOASISProviderSettings BitcoinOASIS { get; set; }
public CardanoOASISProviderSettings CardanoOASIS { get; set; }
public PolkadotOASISProviderSettings PolkadotOASIS { get; set; }
public BNBChainOASISProviderSettings BNBChainOASIS { get; set; }
public FantomOASISProviderSettings FantomOASIS { get; set; }
public OptimismOASISProviderSettings OptimismOASIS { get; set; }
public ChainLinkOASISProviderSettings ChainLinkOASIS { get; set; }
public ElrondOASISProviderSettings ElrondOASIS { get; set; }
public AptosOASISProviderSettings AptosOASIS { get; set; }
public TRONOASISProviderSettings TRONOASIS { get; set; }
public HashgraphOASISProviderSettings HashgraphOASIS { get; set; }
public AvalancheOASISProviderSettings AvalancheOASIS { get; set; }
public CosmosBlockChainOASISProviderSettings CosmosBlockChainOASIS { get; set; }
public NEAROASISProviderSettings NEAROASIS { get; set; }
public BaseOASISProviderSettings BaseOASIS { get; set; }
public SuiOASISProviderSettings SuiOASIS { get; set; }
public MoralisOASISProviderSettings MoralisOASIS { get; set; }
// Network Providers
public ActivityPubOASISProviderSettings ActivityPubOASIS { get; set; }
public GoogleCloudOASISProviderSettings GoogleCloudOASIS { get; set; }
}
public class EmailSettings
{
public string EmailFrom { get; set; }
public string SmtpHost { get; set; }
public int SmtpPort { get; set; }
public string SmtpUser { get; set; }
public string SmtpPass { get; set; }
public bool DisableAllEmails { get; set; } //This overrides the SendVerificationEmail setting below. MAKE SURE THIS IS FALSE FOR LIVE!
public bool SendVerificationEmail { get; set; }
public string OASISWebSiteURL { get; set; }
}
public class ProviderSettingsBase
{
public string ConnectionString { get; set; }
}
public class PinataOASISSettings : ProviderSettingsBase
{
public string ConnectionString { get; set; }
}
public class CargoOASISSettings : ProviderSettingsBase
{
public string SingingMessage { get; set; }
public string PrivateKey { get; set; }
public string HostUrl { get; set; }
}
public class SolanaOASISSettings : ProviderSettingsBase
{
public string WalletMnemonicWords { get; set; }
public string PrivateKey { get; set; }
public string PublicKey { get; set; }
}
//public class HoloOASISProviderSettings : ProviderSettingsBase
public class HoloOASISProviderSettings
{
//public HolochainVersion HolochainVersion { get; set; }
//public string HolochainVersion { get; set; }
public bool UseLocalNode { get; set; }
public bool UseHoloNetwork { get; set; }
public string HoloNetworkURI { get; set; }
public string LocalNodeURI { get; set; }
public bool HoloNETORMUseReflection { get; set; }
// Rust DNA Template Configuration (moved from STARDNA)
public string RustDNARSMTemplateFolder { get; set; } = @"DNATemplates\RustDNATemplates\RSM"; //Rust DNA Templates that hAPPs are built from (relative to BaseSTARPath).
public string RustTemplateLib { get; set; } = @"core\lib.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateHolon { get; set; } = @"core\holon.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateValidation { get; set; } = @"core\validation.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateCreate { get; set; } = @"crud\create.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateRead { get; set; } = @"crud\read.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateUpdate { get; set; } = @"crud\update.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateDelete { get; set; } = @"crud\delete.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateList { get; set; } = @"crud\list.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateInt { get; set; } = @"types\int.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateString { get; set; } = @"types\string.rs"; //relative to RustDNARSMTemplateFolder above.
public string RustTemplateBool { get; set; } = @"types\bool.rs"; //relative to RustDNARSMTemplateFolder above.
public string BaseSTARPath { get; set; } = @"C:\Source\OASIS2\STAR ODK\Releases\STAR_ODK_v3.0.0"; //Base path for STAR templates (if blank then RustDNARSMTemplateFolder is absolute).
}
public class MongoDBOASISProviderSettings : ProviderSettingsBase
{
public string DBName { get; set; }
}
public class EOSIOASISProviderSettings : ProviderSettingsBase
{
public string AccountName { get; set; }
public string AccountPrivateKey { get; set; }
public string ChainId { get; set; }
}
public class SEEDSOASISProviderSettings : ProviderSettingsBase
{
}
public class ThreeFoldOASISProviderSettings : ProviderSettingsBase
{
}
public class EthereumOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public long ChainId { get; set; }
public string ContractAddress { get; set; }
}
public class ArbitrumOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public long ChainId { get; set; }
public string ContractAddress { get; set; }
}
public class PolygonOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public string ContractAddress { get; set; }
public string Abi { get; set; }
}
public class RootstockOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public string ContractAddress { get; set; }
public string Abi { get; set; }
}
public class SQLLiteDBOASISSettings : ProviderSettingsBase
{
}
public class IPFSOASISSettings : ProviderSettingsBase
{
public string LookUpIPFSAddress { get; set; }
}
public class Neo4jOASISSettings : ProviderSettingsBase
{
public string Username { get; set; }
public string Password { get; set; }
}
public class LocalFileOASISSettings
{
public string FilePath { get; set; }
}
public class AzureOASISProviderSettings
{
public string ServiceEndpoint { get; set; }
public string AuthKey { get; set; }
public string DBName { get; set; }
public string CollectionNames { get; set; }
}
// Enhanced HyperDrive Configuration Classes
public class ReplicationRulesConfig
{
public string Mode { get; set; } = "Auto";
public bool IsEnabled { get; set; } = true;
public int MaxReplicationsPerMonth { get; set; } = 1000;
public decimal CostThreshold { get; set; } = 10.00m;
public bool FreeProvidersOnly { get; set; } = true;
public decimal GasFeeThreshold { get; set; } = 0.01m;
public List<ReplicationTriggerConfig> ReplicationTriggers { get; set; } = new List<ReplicationTriggerConfig>();
public List<ProviderReplicationRuleConfig> ProviderRules { get; set; } = new List<ProviderReplicationRuleConfig>();
public List<DataTypeReplicationRuleConfig> DataTypeRules { get; set; } = new List<DataTypeReplicationRuleConfig>();
public List<ScheduleRuleConfig> ScheduleRules { get; set; } = new List<ScheduleRuleConfig>();
public CostOptimizationRuleConfig CostOptimization { get; set; } = new CostOptimizationRuleConfig();
public IntelligentSelectionRuleConfig IntelligentSelection { get; set; } = new IntelligentSelectionRuleConfig();
}
public class FailoverRulesConfig
{
public string Mode { get; set; } = "Auto";
public bool IsEnabled { get; set; } = true;
public int MaxFailoversPerMonth { get; set; } = 100;
public decimal CostThreshold { get; set; } = 5.00m;
public bool FreeProvidersOnly { get; set; } = true;
public decimal GasFeeThreshold { get; set; } = 0.01m;
public List<FailoverTriggerConfig> FailoverTriggers { get; set; } = new List<FailoverTriggerConfig>();
public List<ProviderFailoverRuleConfig> ProviderRules { get; set; } = new List<ProviderFailoverRuleConfig>();
public IntelligentSelectionRuleConfig IntelligentSelection { get; set; } = new IntelligentSelectionRuleConfig();
public List<EscalationRuleConfig> EscalationRules { get; set; } = new List<EscalationRuleConfig>();
}
public class SubscriptionConfig
{
public string PlanType { get; set; } = "Free";
public int MaxReplicationsPerMonth { get; set; } = 100;
public int MaxFailoversPerMonth { get; set; } = 10;
public int MaxStorageGB { get; set; } = 1;
public bool PayAsYouGoEnabled { get; set; } = false;
public decimal CostPerReplication { get; set; } = 0.01m;
public decimal CostPerFailover { get; set; } = 0.05m;
public decimal CostPerGB { get; set; } = 0.10m;
public string Currency { get; set; } = "USD";
public string BillingCycle { get; set; } = "Monthly";
public List<UsageAlertConfig> UsageAlerts { get; set; } = new List<UsageAlertConfig>();
public List<QuotaNotificationConfig> QuotaNotifications { get; set; } = new List<QuotaNotificationConfig>();
}
public class DataPermissionsConfig
{
public AvatarPermissionsConfig AvatarPermissions { get; set; } = new AvatarPermissionsConfig();
public HolonPermissionsConfig HolonPermissions { get; set; } = new HolonPermissionsConfig();
public ProviderPermissionsConfig ProviderPermissions { get; set; } = new ProviderPermissionsConfig();
public FieldLevelPermissionsConfig FieldLevelPermissions { get; set; } = new FieldLevelPermissionsConfig();
public AccessControlConfig AccessControl { get; set; } = new AccessControlConfig();
}
public class IntelligentModeConfig
{
public bool IsEnabled { get; set; } = true;
public bool AutoOptimization { get; set; } = true;
public bool CostAwareness { get; set; } = true;
public bool PerformanceOptimization { get; set; } = true;
public bool SecurityOptimization { get; set; } = true;
public bool LearningEnabled { get; set; } = true;
public string AdaptationSpeed { get; set; } = "Medium";
public List<OptimizationGoalConfig> OptimizationGoals { get; set; } = new List<OptimizationGoalConfig>();
}
// Supporting configuration classes
public class ReplicationTriggerConfig
{
public string Id { get; set; }
public string Name { get; set; }
public ReplicationConditionConfig Condition { get; set; }
public string Priority { get; set; } = "Medium";
public bool IsEnabled { get; set; } = true;
public ReplicationActionConfig Action { get; set; }
}
public class ReplicationConditionConfig
{
public string Type { get; set; }
public string Operator { get; set; }
public object Value { get; set; }
public string Field { get; set; }
public string ProviderType { get; set; }
public TimeWindowConfig TimeWindow { get; set; }
}
public class ReplicationActionConfig
{
public string Type { get; set; }
public List<string> TargetProviders { get; set; } = new List<string>();
public List<string> DataTypes { get; set; } = new List<string>();
public DataPermissionsConfig Permissions { get; set; }
public decimal CostLimit { get; set; }
public ScheduleConfig Schedule { get; set; }
}
public class ProviderReplicationRuleConfig
{
public string ProviderType { get; set; }
public bool IsEnabled { get; set; } = true;
public int Priority { get; set; } = 1;
public decimal CostLimit { get; set; }
public decimal GasFeeLimit { get; set; }
public List<string> DataTypes { get; set; } = new List<string>();
public DataPermissionsConfig Permissions { get; set; }
public List<ReplicationConditionConfig> Conditions { get; set; } = new List<ReplicationConditionConfig>();
public ScheduleConfig Schedule { get; set; }
}
public class DataTypeReplicationRuleConfig
{
public string DataType { get; set; }
public bool IsEnabled { get; set; } = true;
public List<string> RequiredProviders { get; set; } = new List<string>();
public List<string> OptionalProviders { get; set; } = new List<string>();
public DataPermissionsConfig Permissions { get; set; }
public decimal CostLimit { get; set; }
public ScheduleConfig Schedule { get; set; }
}
public class ScheduleRuleConfig
{
public string Name { get; set; }
public bool IsEnabled { get; set; } = true;
public ScheduleConfig Schedule { get; set; }
public List<string> DataTypes { get; set; } = new List<string>();
public List<string> Providers { get; set; } = new List<string>();
public DataPermissionsConfig Permissions { get; set; }
}
public class CostOptimizationRuleConfig
{
public bool IsEnabled { get; set; } = true;
public decimal MaxCostPerReplication { get; set; } = 0.01m;
public decimal MaxCostPerMonth { get; set; } = 10.00m;
public List<string> PreferredFreeProviders { get; set; } = new List<string>();
public bool AvoidHighGasProviders { get; set; } = true;
public decimal GasFeeThreshold { get; set; } = 0.01m;
public decimal CostAlertThreshold { get; set; } = 5.00m;
}
public class IntelligentSelectionRuleConfig
{
public bool IsEnabled { get; set; } = true;
public string Algorithm { get; set; } = "Intelligent";
public SelectionWeightsConfig Weights { get; set; } = new SelectionWeightsConfig();
public bool LearningEnabled { get; set; } = true;
public string AdaptationSpeed { get; set; } = "Medium";
public List<OptimizationGoalConfig> OptimizationGoals { get; set; } = new List<OptimizationGoalConfig>();
}
public class FailoverTriggerConfig
{
public string Id { get; set; }
public string Name { get; set; }
public FailoverConditionConfig Condition { get; set; }
public string Priority { get; set; } = "Medium";
public bool IsEnabled { get; set; } = true;
public FailoverActionConfig Action { get; set; }
}
public class FailoverConditionConfig
{
public string Type { get; set; }
public string Operator { get; set; }
public object Value { get; set; }
public string ProviderType { get; set; }
public TimeWindowConfig TimeWindow { get; set; }
public decimal? Threshold { get; set; }
}
public class FailoverActionConfig
{
public string Type { get; set; }
public string TargetProvider { get; set; }
public List<string> FallbackProviders { get; set; } = new List<string>();
public decimal CostLimit { get; set; }
public ScheduleConfig Schedule { get; set; }
}
public class ProviderFailoverRuleConfig
{
public string ProviderType { get; set; }
public bool IsEnabled { get; set; } = true;
public int Priority { get; set; } = 1;
public decimal CostLimit { get; set; }
public decimal GasFeeLimit { get; set; }
public List<FailoverConditionConfig> Conditions { get; set; } = new List<FailoverConditionConfig>();
public List<string> FallbackProviders { get; set; } = new List<string>();
}
public class EscalationRuleConfig
{
public string Name { get; set; }
public string Level { get; set; } = "Medium";
public FailoverConditionConfig Condition { get; set; }
public FailoverActionConfig Action { get; set; }
public NotificationRuleConfig Notification { get; set; }
}
public class AvatarPermissionsConfig
{
public bool IsEnabled { get; set; } = true;
public List<AvatarFieldPermissionConfig> Fields { get; set; } = new List<AvatarFieldPermissionConfig>();
public string DefaultPermission { get; set; } = "Read";
public Dictionary<string, List<AvatarFieldPermissionConfig>> ProviderOverrides { get; set; } = new Dictionary<string, List<AvatarFieldPermissionConfig>>();
}
public class AvatarFieldPermissionConfig
{
public string FieldName { get; set; }
public string Permission { get; set; } = "Read";
public bool IsEncrypted { get; set; } = false;
public bool IsRequired { get; set; } = false;
public List<string> ProviderTypes { get; set; } = new List<string>();
}
public class HolonPermissionsConfig
{
public bool IsEnabled { get; set; } = true;
public List<HolonTypePermissionConfig> HolonTypes { get; set; } = new List<HolonTypePermissionConfig>();
public string DefaultPermission { get; set; } = "Read";
public Dictionary<string, List<HolonTypePermissionConfig>> ProviderOverrides { get; set; } = new Dictionary<string, List<HolonTypePermissionConfig>>();
}
public class HolonTypePermissionConfig
{
public string HolonType { get; set; }
public string Permission { get; set; } = "Read";
public bool IsEncrypted { get; set; } = false;
public bool IsRequired { get; set; } = false;
public List<string> ProviderTypes { get; set; } = new List<string>();
public List<HolonFieldPermissionConfig> Fields { get; set; } = new List<HolonFieldPermissionConfig>();
}
public class HolonFieldPermissionConfig
{
public string FieldName { get; set; }
public string Permission { get; set; } = "Read";
public bool IsEncrypted { get; set; } = false;
public bool IsRequired { get; set; } = false;
}
public class ProviderPermissionsConfig
{
public bool IsEnabled { get; set; } = true;
public List<ProviderPermissionConfig> Providers { get; set; } = new List<ProviderPermissionConfig>();
}
public class ProviderPermissionConfig
{
public string ProviderType { get; set; }
public string Permission { get; set; } = "Read";
public List<string> AllowedDataTypes { get; set; } = new List<string>();
public decimal CostLimit { get; set; }
public decimal GasFeeLimit { get; set; }
public ScheduleConfig Schedule { get; set; }
}
public class FieldLevelPermissionsConfig
{
public bool IsEnabled { get; set; } = true;
public List<FieldPermissionRuleConfig> Rules { get; set; } = new List<FieldPermissionRuleConfig>();
}
public class FieldPermissionRuleConfig
{
public string FieldPath { get; set; }
public string DataType { get; set; }
public Dictionary<string, string> Permissions { get; set; } = new Dictionary<string, string>();
public Dictionary<string, bool> Encryption { get; set; } = new Dictionary<string, bool>();
public Dictionary<string, bool> Required { get; set; } = new Dictionary<string, bool>();
}
public class AccessControlConfig
{
public bool IsEnabled { get; set; } = true;
public bool AuthenticationRequired { get; set; } = true;
public string AuthorizationLevel { get; set; } = "Authenticated";
public string EncryptionLevel { get; set; } = "Standard";
public bool AuditLogging { get; set; } = true;
public List<AccessPolicyConfig> AccessPolicies { get; set; } = new List<AccessPolicyConfig>();
}
public class AccessPolicyConfig
{
public string Name { get; set; }
public AccessConditionConfig Condition { get; set; }
public string Permissions { get; set; } = "Read";
public List<string> Providers { get; set; } = new List<string>();
public List<string> DataTypes { get; set; } = new List<string>();
}
public class AccessConditionConfig
{
public string UserRole { get; set; }
public string SubscriptionPlan { get; set; }
public TimeWindowConfig TimeWindow { get; set; }
public string Location { get; set; }
public string DeviceType { get; set; }
}
public class UsageAlertConfig
{
public string Id { get; set; }
public string Name { get; set; }
public decimal Threshold { get; set; }
public string ThresholdType { get; set; } = "Percentage";
public List<string> NotificationChannels { get; set; } = new List<string>();
public bool IsEnabled { get; set; } = true;
}
public class QuotaNotificationConfig
{
public string Id { get; set; }
public string Name { get; set; }
public string QuotaType { get; set; }
public decimal Threshold { get; set; }
public List<string> NotificationChannels { get; set; } = new List<string>();
public List<QuotaActionConfig> Actions { get; set; } = new List<QuotaActionConfig>();
public bool IsEnabled { get; set; } = true;
}
public class QuotaActionConfig
{
public string Type { get; set; }
public object Value { get; set; }
public ScheduleConfig Schedule { get; set; }
}
public class NotificationRuleConfig
{
public List<string> Channels { get; set; } = new List<string>();
public string Message { get; set; }
public string Priority { get; set; } = "Medium";
public bool IsEnabled { get; set; } = true;
}
public class ScheduleConfig
{
public string Type { get; set; } = "Immediate";
public int? Interval { get; set; }
public string IntervalUnit { get; set; } = "Hours";
public string CronExpression { get; set; }
public string TimeZone { get; set; } = "UTC";
public string StartTime { get; set; }
public string EndTime { get; set; }
public List<string> DaysOfWeek { get; set; } = new List<string>();
public List<int> DaysOfMonth { get; set; } = new List<int>();
}
public class TimeWindowConfig
{
public string Start { get; set; }
public string End { get; set; }
public string TimeZone { get; set; } = "UTC";
public List<string> DaysOfWeek { get; set; } = new List<string>();
}
public class SelectionWeightsConfig
{
public decimal Cost { get; set; } = 0.3m;
public decimal Performance { get; set; } = 0.3m;
public decimal Reliability { get; set; } = 0.2m;
public decimal Security { get; set; } = 0.1m;
public decimal Geographic { get; set; } = 0.05m;
public decimal Availability { get; set; } = 0.05m;
}
public class OptimizationGoalConfig
{
public string Type { get; set; }
public decimal Weight { get; set; }
public decimal Target { get; set; }
public bool IsEnabled { get; set; } = true;
}
// Missing Blockchain Provider Settings Classes
public class BitcoinOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://blockstream.info/api";
public string Network { get; set; } = "mainnet";
}
public class CardanoOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://cardano-mainnet.blockfrost.io/api/v0";
public string NetworkId { get; set; } = "mainnet";
public string ProjectId { get; set; }
}
public class PolkadotOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "wss://rpc.polkadot.io";
public string Network { get; set; } = "polkadot";
}
public class BNBChainOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://bsc-dataseed.binance.org";
public string NetworkId { get; set; } = "56";
public string ChainId { get; set; } = "0x38";
}
public class FantomOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://rpc.ftm.tools";
public string NetworkId { get; set; } = "250";
public string ChainId { get; set; } = "0xfa";
}
public class OptimismOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://mainnet.optimism.io";
public string NetworkId { get; set; } = "10";
public string ChainId { get; set; } = "0xa";
}
public class ChainLinkOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://mainnet.infura.io/v3/YOUR_PROJECT_ID";
public string NetworkId { get; set; } = "1";
public string ChainId { get; set; } = "0x1";
}
public class ElrondOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://api.elrond.com";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "1";
}
public class AptosOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://api.mainnet.aptoslabs.com/v1";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "1";
public string PrivateKey { get; set; } = "";
public string ContractAddress { get; set; } = "0x1";
}
public class TRONOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://api.trongrid.io";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "0x2b6653dc";
}
public class HashgraphOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://mainnet-public.mirrornode.hedera.com/api/v1";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "295";
}
public class AvalancheOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://api.avax.network/ext/bc/C/rpc";
public string NetworkId { get; set; } = "43114";
public string ChainId { get; set; } = "0xa86a";
public string ChainPrivateKey { get; set; } = "";
public string ContractAddress { get; set; } = "";
}
public class CosmosBlockChainOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://cosmos-rpc.polkachu.com";
public string Network { get; set; } = "cosmos";
public string ChainId { get; set; } = "cosmoshub-4";
}
public class NEAROASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://rpc.mainnet.near.org";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "mainnet";
}
public class BaseOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://mainnet.base.org";
public string NetworkId { get; set; } = "8453";
public string ChainId { get; set; } = "0x2105";
public string ChainPrivateKey { get; set; } = "";
public string ContractAddress { get; set; } = "";
}
public class SuiOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://fullnode.mainnet.sui.io:443";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "mainnet";
public string ContractAddress { get; set; } = "";
}
public class MoralisOASISProviderSettings : ProviderSettingsBase
{
public string ApiKey { get; set; }
public string RpcEndpoint { get; set; } = "https://speedy-nodes-nyc.moralis.io/YOUR_API_KEY/eth/mainnet";
public string Network { get; set; } = "mainnet";
}
public class TelosOASISProviderSettings : ProviderSettingsBase
{
public string RpcEndpoint { get; set; } = "https://api.telos.net";
public string Network { get; set; } = "mainnet";
public string ChainId { get; set; } = "4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11";
}
public class ActivityPubOASISProviderSettings : ProviderSettingsBase
{
public string BaseUrl { get; set; } = "https://mastodon.social/api/v1";
public string UserAgent { get; set; } = "OASIS-ActivityPub-Provider/1.0";
public string AcceptHeader { get; set; } = "application/json";
public int TimeoutSeconds { get; set; } = 30;
public bool EnableCaching { get; set; } = true;
public int CacheExpirationMinutes { get; set; } = 15;
}
public class GoogleCloudOASISProviderSettings : ProviderSettingsBase
{
public string ProjectId { get; set; } = "oasis-project";
public string BucketName { get; set; } = "oasis-storage";
public string CredentialsPath { get; set; }
public string FirestoreDatabaseId { get; set; } = "(default)";
public string BigQueryDatasetId { get; set; } = "oasis_data";
public bool EnableStorage { get; set; } = true;
public bool EnableFirestore { get; set; } = true;
public bool EnableBigQuery { get; set; } = true;
}
}