Пример #1
0
 public DBTrieInvoiceRepository(IOptions <Config> conf, IKeysRepository keysRepository, ISystemClock systemClock, NRustLightningNetworkProvider networkProvider, ILogger <DBTrieInvoiceRepository> logger)
 {
     _dbPath          = conf.Value.InvoiceDBFilePath;
     _keysRepository  = keysRepository;
     _systemClock     = systemClock;
     _networkProvider = networkProvider;
     _logger          = logger;
     _engine          = DBTrieEngine.OpenFromFolder(_dbPath).Result;
     _engine.ConfigurePagePool(new PagePool(pageSize: conf.Value.DBCacheMB));
 }
Пример #2
0
        public DbTrieRepository(IOptions <Config> conf, ILogger <DbTrieRepository> logger)
        {
            _dbPath = conf.Value.DBFilePath;
            _conf   = conf;
            _logger = logger;
            _pool   = MemoryPool <byte> .Shared;
            _engine = OpenEngine(CancellationToken.None).GetAwaiter().GetResult();
            var pageSize = 8192;

            _engine.ConfigurePagePool(new PagePool(pageSize, (_conf.Value.DBCacheMB * 1000 * 1000) / pageSize));
        }