Skip to content

Commit

Permalink
chore: network specific storage paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnordh authored Jan 16, 2025
1 parent a75124a commit 84fd4f7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ class LightningNodeService {

self.network = Network(stringValue: storedNetworkString) ?? .signet
self.keyService = keyService

let documentsPath = FileManager.default.getDocumentsDirectoryPath()
let networkPath = URL(fileURLWithPath: documentsPath)
.appendingPathComponent(network.description)
.path
let logPath = networkPath + "/logs"

try? FileManager.default.createDirectory(
atPath: logPath,
withIntermediateDirectories: true
)

var config = defaultConfig()
config.storageDirPath = FileManager.default.getDocumentsDirectoryPath()
config.logDirPath = FileManager.default.getDocumentsDirectoryPath()
config.storageDirPath = networkPath
config.logDirPath = logPath
config.network = self.network
config.trustedPeers0conf = [
Constants.Config.LiquiditySourceLsps2.Signet.lqwd.nodeId
Expand Down

0 comments on commit 84fd4f7

Please sign in to comment.