From 951f45523cb70ab80cab1693c806ad42e61b80fb Mon Sep 17 00:00:00 2001 From: "Justin (shocknet)" <34176400+shocknet-justin@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:02:02 -0500 Subject: [PATCH 1/6] Update env.example --- env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/env.example b/env.example index b238ad6d..0eb5183e 100644 --- a/env.example +++ b/env.example @@ -22,6 +22,7 @@ #LOCALHOST #ADMIN_TOKEN= +#METRICS_TOKEN= #PORT=1776 #JWT_SECRET= From 81bde0c1f0be19d3019a819070f5c159501fd036 Mon Sep 17 00:00:00 2001 From: "Justin (shocknet)" <34176400+shocknet-justin@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:03:27 -0500 Subject: [PATCH 2/6] Update env.example --- env.example | 1 - 1 file changed, 1 deletion(-) diff --git a/env.example b/env.example index 0eb5183e..b238ad6d 100644 --- a/env.example +++ b/env.example @@ -22,7 +22,6 @@ #LOCALHOST #ADMIN_TOKEN= -#METRICS_TOKEN= #PORT=1776 #JWT_SECRET= From 853f7d5a70bce6a08b082bed489dc347fba0e490 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Tue, 28 Jan 2025 17:33:40 +0000 Subject: [PATCH 3/6] files fix --- env.example | 1 + src/services/storage/metricsEventStorage.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/env.example b/env.example index b238ad6d..b73b4ad0 100644 --- a/env.example +++ b/env.example @@ -19,6 +19,7 @@ #DATABASE_FILE=db.sqlite #METRICS_DATABASE_FILE=metrics.sqlite #LOGS_DIR=logs +#DATA_DIR= #LOCALHOST #ADMIN_TOKEN= diff --git a/src/services/storage/metricsEventStorage.ts b/src/services/storage/metricsEventStorage.ts index a1447883..b340bd96 100644 --- a/src/services/storage/metricsEventStorage.ts +++ b/src/services/storage/metricsEventStorage.ts @@ -15,8 +15,8 @@ export default class { lastPersistedCache: number = 0 constructor(settings: StorageSettings) { this.settings = settings; - this.metricsPath = [settings.dataDir, "metric_events"].join("/") - this.cachePath = [settings.dataDir, "metric_cache"].join("/") + this.metricsPath = [settings.dataDir, "metric_events"].filter(s => !!s).join("/") + this.cachePath = [settings.dataDir, "metric_cache"].filter(s => !!s).join("/") if (!fs.existsSync(this.cachePath)) { fs.mkdirSync(this.cachePath, { recursive: true }); } From a386eb8f4f96f0bf55e23280963844c50fa336b8 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Tue, 28 Jan 2025 18:00:41 +0000 Subject: [PATCH 4/6] wallet paths --- env.example | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/env.example b/env.example index b73b4ad0..3da1de47 100644 --- a/env.example +++ b/env.example @@ -19,7 +19,13 @@ #DATABASE_FILE=db.sqlite #METRICS_DATABASE_FILE=metrics.sqlite #LOGS_DIR=logs +# directory where app data will be stored #DATA_DIR= +# file path for wallet secret, will be used to encrypt the seed, and converted as hex into bytes to make a password, if the password file is not provided or empty +#WALLET_SECRET_PATH= +# file path for wallet password +#WALLET_PASSWORD_PATH= + #LOCALHOST #ADMIN_TOKEN= From 71479058752db6db4a23f49c923db4f1a3c2f539 Mon Sep 17 00:00:00 2001 From: "Justin (shocknet)" <34176400+shocknet-justin@users.noreply.github.com> Date: Tue, 28 Jan 2025 13:13:25 -0500 Subject: [PATCH 5/6] Update env.example --- env.example | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/env.example b/env.example index 3da1de47..d35a7c0f 100644 --- a/env.example +++ b/env.example @@ -21,9 +21,10 @@ #LOGS_DIR=logs # directory where app data will be stored #DATA_DIR= -# file path for wallet secret, will be used to encrypt the seed, and converted as hex into bytes to make a password, if the password file is not provided or empty +# Pub will generate a ranom secret to encrypt the seed phrase in the database. +# Specify a location only if you require privleged storage, else it will be stored in the Pub data dir. #WALLET_SECRET_PATH= -# file path for wallet password +# If using a password file directly within LND's configuration, specify it here for Pub to use it for unlocking. #WALLET_PASSWORD_PATH= From 00f2caf7df9ab1386c6ac3782c19f88e679dceb9 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Wed, 29 Jan 2025 16:52:27 +0000 Subject: [PATCH 6/6] try catch get tx --- src/services/metrics/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/services/metrics/index.ts b/src/services/metrics/index.ts index 0a7a19c6..aaf8b7c9 100644 --- a/src/services/metrics/index.ts +++ b/src/services/metrics/index.ts @@ -327,8 +327,13 @@ export default class Handler { } }) const closed = await Promise.all(closedChannels.filter(c => c.closeType !== ChannelCloseSummary_ClosureType.FUNDING_CANCELED).map(async c => { - const tx = await this.lnd.GetTx(c.closingTxHash) - return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) } + try { + const tx = await this.lnd.GetTx(c.closingTxHash) + return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) } + } catch (e) { + return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: 0 } + } + })) return { nodes: [{