@@ -19,21 +19,6 @@ extension CbfClient {
1919
2020 static func createComponents( wallet: Wallet ) -> ( client: CbfClient , node: CbfNode ) {
2121 do {
22- #if DEBUG
23- let dataDirPath = Constants . Config. Kyoto. dbPath
24- print ( " [Kyoto] dataDir: \( dataDirPath) " )
25- do {
26- let testFile = ( dataDirPath as NSString ) . appendingPathComponent ( " .write_test " )
27- try Data ( " ok " . utf8) . write ( to: URL ( fileURLWithPath: testFile) )
28- try ? FileManager . default. removeItem ( atPath: testFile)
29- print ( " [Kyoto] dataDir writable: true " )
30- } catch {
31- print ( " [Kyoto] dataDir writable: false error= \( error) " )
32- }
33- let peers = Constants . Networks. Signet. Regular. kyotoPeers
34- print ( " [Kyoto] peers count: \( peers. count) " )
35- for peer in peers { print ( " [Kyoto] peer: \( peer) " ) }
36- #endif
3722
3823 let components = try CbfBuilder ( )
3924 . logLevel ( logLevel: . debug)
@@ -43,14 +28,8 @@ extension CbfClient {
4328 . build ( wallet: wallet)
4429
4530 components. node. run ( )
46- #if DEBUG
47- print ( " [Kyoto] node started; peers= \( Constants . Networks. Signet. Regular. kyotoPeers. count) " )
48- #endif
4931
5032 components. client. startBackgroundMonitoring ( )
51- #if DEBUG
52- print ( " [Kyoto] background monitoring started " )
53- #endif
5433
5534 return ( client: components. client, node: components. node)
5635 } catch {
@@ -70,9 +49,6 @@ extension CbfClient {
7049 CbfClient . monitoringTasksQueue. sync { Self . lastInfoAt [ id] = Date ( ) }
7150 switch info {
7251 case let . progress( progress) :
73- #if DEBUG
74- print ( " [Kyoto] progress: \( progress) " )
75- #endif
7652 await MainActor . run {
7753 NotificationCenter . default. post (
7854 name: NSNotification . Name ( " KyotoProgressUpdate " ) ,
@@ -81,9 +57,6 @@ extension CbfClient {
8157 )
8258 }
8359 case let . newChainHeight( height) :
84- #if DEBUG
85- print ( " [Kyoto] newChainHeight: \( height) " )
86- #endif
8760 await MainActor . run {
8861 NotificationCenter . default. post (
8962 name: NSNotification . Name ( " KyotoChainHeightUpdate " ) ,
@@ -100,9 +73,6 @@ extension CbfClient {
10073 }
10174 }
10275 case . connectionsMet, . successfulHandshake:
103- #if DEBUG
104- print ( " [Kyoto] connections established " )
105- #endif
10676 await MainActor . run {
10777 if !hasEstablishedConnection {
10878 hasEstablishedConnection = true
@@ -139,11 +109,6 @@ extension CbfClient {
139109 CbfClient . monitoringTasksQueue. sync {
140110 if let last = Self . lastInfoAt [ id] { idleFor = Date ( ) . timeIntervalSince ( last) }
141111 }
142- #if DEBUG
143- if idleFor >= 5 {
144- print ( " [Kyoto] idle: waiting for info… \( Int ( idleFor) ) s " )
145- }
146- #endif
147112 }
148113 }
149114
@@ -157,9 +122,6 @@ extension CbfClient {
157122 if Task . isCancelled { break }
158123 do {
159124 let warning = try await self . nextWarning ( )
160- #if DEBUG
161- print ( " [Kyoto][warning] \( String ( describing: warning) ) " )
162- #endif
163125 if case . needConnections = warning {
164126 await MainActor . run {
165127 NotificationCenter . default. post (
@@ -186,13 +148,7 @@ extension CbfClient {
186148 while true {
187149 if Task . isCancelled { break }
188150 do {
189- #if DEBUG
190- print ( " [Kyoto] calling nextLog() " )
191- #endif
192151 let log = try await self . nextLog ( )
193- #if DEBUG
194- print ( " [Kyoto] nextLog() returned: \( log) " )
195- #endif
196152 } catch is CancellationError {
197153 break
198154 } catch {
0 commit comments