Skip to content

Commit

Permalink
Kill cardano-testnet nodes by port using fuser
Browse files Browse the repository at this point in the history
  • Loading branch information
errfrom committed Aug 27, 2024
1 parent 1266638 commit c4ca4c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Internal/Testnet/Utils.purs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,13 @@ getNodePort { nodeDir } =
=<< Node.FS.readTextFile UTF8 (nodeDir <</>> "/port")

findNodeDirs :: { workdir :: FilePath } -> Effect (Array { | NodeLocation () })
findNodeDirs { workdir } =
Node.FS.readdir workdir <#> \subdirs ->
findNodeDirs { workdir } = do
let poolsKeysDir = workdir <</>> "pools-keys"
Node.FS.readdir poolsKeysDir <#> \subdirs ->
flip Array.mapMaybe subdirs \dirname -> do
idx <- Int.fromString =<< String.stripPrefix (Pattern "pools-keys/pool1")
idx <- Int.fromString =<< String.stripPrefix (Pattern "pool")
dirname
pure { idx, workdir: workdir <</>> dirname, name: dirname }
pure { idx, workdir: poolsKeysDir <</>> dirname, name: dirname }

findTestnetPaths
:: { workdir :: FilePath } -> Effect (Either Error TestnetPaths)
Expand Down

0 comments on commit c4ca4c8

Please sign in to comment.