11import { spawn } from 'child_process' ;
2- import find from 'find-process' ;
32import path from 'path' ;
43import fs , { WriteStream } from 'fs' ;
54import which from 'which' ;
@@ -9,6 +8,7 @@ import type { Process } from '../utils/processes';
98import type { CardanoNodeProcessNames } from '../../common/types/cardano-node.types' ;
109import { environment } from '../environment' ;
1110import { logger } from '../utils/logging' ;
11+ import { wrappedFind } from '../utils/processes' ;
1212
1313export type SelfnodeOptions = {
1414 selfnodeBin : string ;
@@ -25,7 +25,6 @@ export type Selfnode = {
2525 connected : boolean ;
2626} ;
2727let mockTokenMetadataServer = null ;
28- const platform = String ( environment . platform ) ;
2928const CARDANO_WALLET_PORT = 8088 ;
3029const CARDANO_WALLET_START_TIMEOUT = 60 * 1000 ; // 60 seconds | unit: milliseconds
3130
@@ -69,7 +68,10 @@ export async function CardanoSelfnodeLauncher(
6968 mockTokenMetadataServerLogFile
7069 ) ;
7170 // @ts -ignore ts-migrate(2322) FIXME: Type '{ pid: number; ppid?: number; uid?: number; ... Remove this comment to see the full error message
72- const processList : Array < Process > = await find ( 'port' , CARDANO_WALLET_PORT ) ;
71+ const processList : Array < Process > = await wrappedFind (
72+ 'port' ,
73+ CARDANO_WALLET_PORT
74+ ) ;
7375 const isSelfnodeRunning =
7476 processList . length && processList [ 0 ] . name === processName ;
7577
@@ -216,7 +218,7 @@ const setupMockTokenMetadataServer = async (
216218 } ) ( ) ;
217219
218220 // @ts -ignore ts-migrate(2322) FIXME: Type '{ pid: number; ppid?: number; uid?: number; ... Remove this comment to see the full error message
219- const processList : Array < Process > = await find (
221+ const processList : Array < Process > = await wrappedFind (
220222 'port' ,
221223 TOKEN_METADATA_SERVER_PORT
222224 ) ;
0 commit comments