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;
            }
        }
Example #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);
        }
        public async Task InitializeAsync()
        {
            using (BenchmarkLogger.Measure())
            {
                var initTasks = new[]
                {
                    IndexStore.InitializeAsync(),
                    TransactionStore.InitializeAsync()
                };

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

                IsInitialized = true;
            }
        }
Example #4
0
        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;
            }
        }
Example #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);
            }
        }
        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;
            }
        }