public Global( ITorManager torManager, IDataDirProvider dataDirProvider, Config config, UiConfig uiConfig, ChaincaseWalletManager walletManager, BitcoinStore bitcoinStore, ChaincaseSynchronizer synchronizer, FeeProviders feeProviders ) { _torManager = torManager; _dataDirProvider = dataDirProvider; _config = config; _uiConfig = uiConfig; _walletManager = walletManager; _bitcoinStore = bitcoinStore; _synchronizer = synchronizer; _feeProviders = feeProviders; using (BenchmarkLogger.Measure()) { StoppingCts = new CancellationTokenSource(); Logger.InitializeDefaults(Path.Combine(DataDir, "Logs.txt")); _uiConfig.LoadOrCreateDefaultFile(); } }
public Global(INotificationManager notificationManager, ITorManager torManager, IDataDirProvider dataDirProvider) { TorManager = torManager; NotificationManager = notificationManager; using (BenchmarkLogger.Measure()) { StoppingCts = new CancellationTokenSource(); DataDir = dataDirProvider.Get(); Directory.CreateDirectory(DataDir); Config = new Config(Path.Combine(DataDir, "Config.json")); UiConfig = new UiConfig(Path.Combine(DataDir, "UiConfig.json")); Logger.InitializeDefaults(Path.Combine(DataDir, "Logs.txt")); UiConfig.LoadOrCreateDefaultFile(); Config.LoadOrCreateDefaultFile(); WalletManager = new WalletManager(Network, new WalletDirectories(DataDir)); WalletManager.OnDequeue += WalletManager_OnDequeue; WalletManager.WalletRelevantTransactionProcessed += WalletManager_WalletRelevantTransactionProcessed; var indexStore = new IndexStore(Network, new SmartHeaderChain()); BitcoinStore = new BitcoinStore( Path.Combine(DataDir, "BitcoinStore"), Network, indexStore, new AllTransactionStore(), new MempoolService() ); } }