Skip to content

Commit

Permalink
Drop daml ledger navigator in favor of daml navigator (#12669)
Browse files Browse the repository at this point in the history
fixes #11323

changelog_begin
changelog_end
  • Loading branch information
cocreature authored Feb 1, 2022
1 parent 7731324 commit f1c7e9e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
22 changes: 0 additions & 22 deletions daml-assistant/daml-helper/src/DA/Daml/Helper/Ledger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module DA.Daml.Helper.Ledger (
runLedgerUploadDar,
runLedgerFetchDar,
runLedgerExport,
runLedgerNavigator,
runLedgerReset,
runLedgerGetDalfs,
runLedgerListPackages,
Expand Down Expand Up @@ -536,27 +535,6 @@ runLedgerExport flags remainingArguments = do
exitCode <- waitExitCode ph
exitWith exitCode

-- | Run navigator against configured ledger. We supply Navigator with
-- the list of parties from the ledger, but in the future Navigator
-- should fetch the list of parties itself.
runLedgerNavigator :: LedgerFlags -> [String] -> IO ()
runLedgerNavigator flags remainingArguments = do
args <- getDefaultArgs flags
logbackArg <- getLogbackArg (damlSdkJarFolder </> "navigator-logback.xml")
putStrLn $ "Opening navigator at " <> showHostAndPort args
let navigatorArgs = concat
[ ["server"]
, [host args, show (port args)]
, ["--ignore-project-parties"]
, remainingArguments
]
withJar
damlSdkJar
[logbackArg]
("navigator" : navigatorArgs) $ \ph -> do
exitCode <- waitExitCode ph
exitWith exitCode

--
-- Interface with the Haskell bindings
--------------------------------------
Expand Down
10 changes: 0 additions & 10 deletions daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ data Command
| LedgerFetchDar { flags :: LedgerFlags, pid :: String, saveAs :: FilePath }
| LedgerReset {flags :: LedgerFlags}
| LedgerExport { flags :: LedgerFlags, remainingArguments :: [String] }
| LedgerNavigator { flags :: LedgerFlags, remainingArguments :: [String], shutdownStdinClose :: Bool }
| Codegen { lang :: Lang, remainingArguments :: [String] }
| PackagesList {flags :: LedgerFlags}
| LedgerMeteringReport { flags :: LedgerFlags, from :: IsoTime, to :: Maybe IsoTime, application :: Maybe ApplicationId, compactOutput :: Bool }
Expand Down Expand Up @@ -261,9 +260,6 @@ commandParser = subparser $ fold
, command "fetch-dar" $ info
(ledgerFetchDarCmd <**> helper)
(progDesc "Fetch DAR from ledger into file")
, command "navigator" $ info
(ledgerNavigatorCmd <**> helper)
(forwardOptions <> progDesc "Launch Navigator on ledger")
, command "metering-report" $ info
(ledgerMeteringReportCmd <**> helper)
(forwardOptions <> progDesc "Report on Ledger Use")
Expand Down Expand Up @@ -337,11 +333,6 @@ commandParser = subparser $ fold
<$> ledgerFlags (ShowJsonApi False)
<*> (("script":) <$> many (argument str (metavar "ARG" <> help "Arguments forwarded to export.")))

ledgerNavigatorCmd = LedgerNavigator
<$> ledgerFlags (ShowJsonApi False)
<*> many (argument str (metavar "ARG" <> help "Extra arguments to navigator."))
<*> stdinCloseOpt

app :: ReadM ApplicationId
app = fmap (ApplicationId . pack) str

Expand Down Expand Up @@ -486,7 +477,6 @@ runCommand = \case
LedgerFetchDar {..} -> runLedgerFetchDar flags pid saveAs
LedgerReset {..} -> runLedgerReset flags
LedgerExport {..} -> runLedgerExport flags remainingArguments
LedgerNavigator {..} -> (if shutdownStdinClose then withCloseOnStdin else id) $ runLedgerNavigator flags remainingArguments
Codegen {..} -> runCodegen lang remainingArguments
LedgerMeteringReport {..} -> runLedgerMeteringReport flags from to application compactOutput
CantonSandbox {..} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,24 +478,6 @@ damlStartTests getDamlStart =
(threadDelay 500000)
("http://localhost:" <> show navigatorPort)
[]
subtest "Navigator startup via daml ledger outside project directory" $ do
DamlStartResource {sandboxPort} <- getDamlStart
withTempDir $ \tmpDir -> do
navigatorPort :: Int <- fromIntegral <$> getFreePort
withDamlServiceIn tmpDir "ledger navigator"
["--host"
, "localhost"
, "--port"
, show sandboxPort
, "--port"
, show navigatorPort
] $ \ ph -> do
-- waitForHttpServer will only return once we get a 200 response so we
-- don’t need to do anything else.
waitForHttpServer 240 ph
(threadDelay 500000)
("http://localhost:" <> show navigatorPort)
[]

subtest "hot reload" $ do
DamlStartResource {projDir, jsonApiPort, startStdin, stdoutChan, alice, aliceHeaders} <- getDamlStart
Expand Down

0 comments on commit f1c7e9e

Please sign in to comment.