public BlockExplorerController(IMemoryCache memoryCache,
                                       BlockIndexService indexService,
                                       IOptions <NakoSettings> nakoApiSettings,
                                       IOptions <SetupSettings> setupSettings,
                                       IOptions <FeaturesSettings> featuresSettings)
        {
            _memoryCache  = memoryCache;
            _stats        = JsonConvert.DeserializeObject(_memoryCache.Get("BlockchainStats").ToString());
            _indexService = indexService;

            _nakoApiSettings  = nakoApiSettings.Value;
            _setupSettings    = setupSettings.Value;
            _featuresSettings = featuresSettings.Value;
        }
        public BlockExplorerController(IMemoryCache memoryCache,
                                       BlockIndexService indexService,
                                       IOptions <ExplorerSettings> settings,
                                       IOptions <ChainSettings> chainSettings)
        {
            this.memoryCache = memoryCache;

            if (this.memoryCache.Get("BlockchainStats") != null)
            {
                stats = JsonConvert.DeserializeObject <Status>(this.memoryCache.Get("BlockchainStats").ToString());
            }
            else
            {
                stats = new Status {
                    Error = "BlockchainStats not available yet."
                };
            }

            this.indexService  = indexService;
            this.settings      = settings.Value;
            this.chainSettings = chainSettings.Value;
        }
Example #3
0
 public ApiController(IMemoryCache memoryCache, IOptions <NakoApiSettings> nakoApiSettings, BlockIndexService indexService)
 {
     _memoryCache     = memoryCache;
     _nakoApiSettings = nakoApiSettings.Value;
     _indexService    = indexService;
 }