コード例 #1
0
        public async Task InitializeAsync(string workFolderPath, Network network)
        {
            using (BenchmarkLogger.Measure())
            {
                WorkFolderPath = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
                IoHelpers.EnsureDirectoryExists(WorkFolderPath);

                Network = Guard.NotNull(nameof(network), network);

                IndexStore       = new IndexStore();
                TransactionStore = new AllTransactionStore();
                var networkWorkFolderPath = Path.Combine(WorkFolderPath, Network.ToString());
                var indexStoreFolderPath  = Path.Combine(networkWorkFolderPath, "IndexStore");
                SmartHeaderChain = new SmartHeaderChain();
                MempoolService   = new MempoolService();

                var initTasks = new[]
                {
                    IndexStore.InitializeAsync(indexStoreFolderPath, Network, SmartHeaderChain),
                    TransactionStore.InitializeAsync(networkWorkFolderPath, Network)
                };

                await Task.WhenAll(initTasks).ConfigureAwait(false);

                IsInitialized = true;
            }
        }
コード例 #2
0
        public async Task InitializeAsync(string workFolderPath, Network network)
        {
            WorkFolderPath = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
            IoHelpers.EnsureDirectoryExists(WorkFolderPath);

            Network = Guard.NotNull(nameof(network), network);

            IndexStore = new IndexStore();
            var indexStoreFolderPath = Path.Combine(WorkFolderPath, Network.ToString());

            HashChain = new HashChain();
            await IndexStore.InitializeAsync(indexStoreFolderPath, Network, HashChain);
        }
コード例 #3
0
        public async Task InitializeAsync()
        {
            using (BenchmarkLogger.Measure())
            {
                var initTasks = new[]
                {
                    IndexStore.InitializeAsync(),
                    TransactionStore.InitializeAsync()
                };

                await Task.WhenAll(initTasks).ConfigureAwait(false);

                IsInitialized = true;
            }
        }
コード例 #4
0
ファイル: BitcoinStore.cs プロジェクト: orim4711/WalletWasabi
        public async Task InitializeAsync(CancellationToken cancel = default)
        {
            using (BenchmarkLogger.Measure())
            {
                var initTasks = new[]
                {
                    IndexStore.InitializeAsync(cancel),
                    TransactionStore.InitializeAsync(cancel: cancel)
                };

                await Task.WhenAll(initTasks).ConfigureAwait(false);

                IsInitialized = true;
            }
        }
コード例 #5
0
        public async Task InitializeAsync(string workFolderPath, Network network)
        {
            using (BenchmarkLogger.Measure())
            {
                WorkFolderPath = Guard.NotNullOrEmptyOrWhitespace(nameof(workFolderPath), workFolderPath, trim: true);
                IoHelpers.EnsureDirectoryExists(WorkFolderPath);

                Network = Guard.NotNull(nameof(network), network);

                IndexStore = new IndexStore();
                var indexStoreFolderPath = Path.Combine(WorkFolderPath, Network.ToString(), "IndexStore");
                HashChain      = new HashChain();
                MempoolService = new MempoolService();

                await IndexStore.InitializeAsync(indexStoreFolderPath, Network, HashChain).ConfigureAwait(false);
            }
        }
コード例 #6
0
        public async Task InitializeAsync()
        {
            using (BenchmarkLogger.Measure())
            {
                var networkWorkFolderPath = Path.Combine(WorkFolderPath, Network.ToString());
                var indexStoreFolderPath  = Path.Combine(networkWorkFolderPath, "IndexStore");

                var initTasks = new[]
                {
                    IndexStore.InitializeAsync(indexStoreFolderPath),
                    TransactionStore.InitializeAsync(networkWorkFolderPath, Network)
                };

                await Task.WhenAll(initTasks).ConfigureAwait(false);

                IsInitialized = true;
            }
        }