Merge pull request #317 from bguillaumat/add-cache-dir
Add Dockerization of Mempool v2 for Umbrel App Store
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
"HTTP_PORT": 8999,
|
||||
"SPAWN_CLUSTER_PROCS": 0,
|
||||
"API_URL_PREFIX": "/api/v1/",
|
||||
"POLL_RATE_MS": 2000
|
||||
"POLL_RATE_MS": 2000,
|
||||
"CACHE_DIR": "./"
|
||||
},
|
||||
"CORE_RPC": {
|
||||
"HOST": "127.0.0.1",
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"locutus": "^2.0.12",
|
||||
"mysql2": "2.2.5",
|
||||
"node-worker-threads-pool": "^1.4.2",
|
||||
"typescript": "~3.9.7",
|
||||
"ws": "^7.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -4,10 +4,11 @@ import * as cluster from 'cluster';
|
||||
import memPool from './mempool';
|
||||
import blocks from './blocks';
|
||||
import logger from '../logger';
|
||||
import config from '../config';
|
||||
|
||||
class DiskCache {
|
||||
private static FILE_NAME = './cache.json';
|
||||
private static FILE_NAMES = './cache{number}.json';
|
||||
private static FILE_NAME = config.MEMPOOL.CACHE_DIR + 'cache.json';
|
||||
private static FILE_NAMES = config.MEMPOOL.CACHE_DIR + 'cache{number}.json';
|
||||
private static CHUNK_SIZE = 10000;
|
||||
constructor() { }
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ interface IConfig {
|
||||
SPAWN_CLUSTER_PROCS: number;
|
||||
API_URL_PREFIX: string;
|
||||
POLL_RATE_MS: number;
|
||||
CACHE_DIR: string;
|
||||
};
|
||||
ESPLORA: {
|
||||
REST_API_URL: string;
|
||||
@@ -66,7 +67,8 @@ const defaults: IConfig = {
|
||||
'HTTP_PORT': 8999,
|
||||
'SPAWN_CLUSTER_PROCS': 0,
|
||||
'API_URL_PREFIX': '/api/v1/',
|
||||
'POLL_RATE_MS': 2000
|
||||
'POLL_RATE_MS': 2000,
|
||||
'CACHE_DIR': './'
|
||||
},
|
||||
'ESPLORA': {
|
||||
'REST_API_URL': 'http://127.0.0.1:3000',
|
||||
|
||||
Reference in New Issue
Block a user