diff --git a/app/cardano-rt-view.hs b/app/cardano-rt-view.hs index ce595fe..0fbd49c 100644 --- a/app/cardano-rt-view.hs +++ b/app/cardano-rt-view.hs @@ -13,4 +13,4 @@ main = do where rtViewInfo :: ParserInfo RTViewParams rtViewInfo = info (parseRTViewParams <**> helper) - (fullDesc <> header "cardano-rt-view-service - real-time view for cardano node.") + (fullDesc <> header "cardano-rt-view - real-time view for cardano node.") diff --git a/cardano-rt-view.cabal b/cardano-rt-view.cabal index e3abde1..b04f747 100644 --- a/cardano-rt-view.cabal +++ b/cardano-rt-view.cabal @@ -76,7 +76,7 @@ library -Wpartial-fields -Wcompat -executable cardano-rt-view-service +executable cardano-rt-view hs-source-dirs: app main-is: cardano-rt-view.hs default-language: Haskell2010 diff --git a/default.nix b/default.nix index 5c29119..4edd497 100644 --- a/default.nix +++ b/default.nix @@ -26,7 +26,7 @@ let # Grab the executable component of our package. inherit (haskellPackages.cardano-rt-view.components.exes) - cardano-rt-view-service; + cardano-rt-view; inherit (haskellPackages.cardano-rt-view.identifier) version; # `tests` are the test suites which have been built. diff --git a/nix/darwin-release.nix b/nix/darwin-release.nix index f6baa2f..c6e63fa 100644 --- a/nix/darwin-release.nix +++ b/nix/darwin-release.nix @@ -1,5 +1,5 @@ ############################################################################ -# Darwin release cardano-rt-view-service-*.zip +# Darwin release cardano-rt-view-*.zip # # This bundles up the macOS executable with its dependencies # and static directory. Result is *.zip file. @@ -14,8 +14,8 @@ let lib = pkgs.lib; - name = "cardano-rt-view-service-${project.version}-darwin"; - rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view-service" exe.name) exes); + name = "cardano-rt-view-${project.version}-darwin"; + rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view" exe.name) exes); in pkgs.runCommand name { buildInputs = with pkgs.buildPackages; [ diff --git a/nix/linux-release.nix b/nix/linux-release.nix index f18beac..fedea08 100644 --- a/nix/linux-release.nix +++ b/nix/linux-release.nix @@ -1,8 +1,8 @@ ############################################################################ -# Linux release cardano-rt-view-service-*.AppImage +# Linux release cardano-rt-view-*.tar.gz # # This bundles up the linux executable with its dependencies -# and static directory. Result is *.AppImage file. +# and static directory. Result is *.tar.gz archive. # ############################################################################ @@ -14,8 +14,8 @@ let lib = pkgs.lib; - name = "cardano-rt-view-service-${project.version}-linux-x86_64"; - rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view-service" exe.name) exes); + name = "cardano-rt-view-${project.version}-linux-x86_64"; + rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view" exe.name) exes); in pkgs.runCommand name { buildInputs = with pkgs.buildPackages; [ diff --git a/nix/windows-release.nix b/nix/windows-release.nix index 50bcb10..b879281 100644 --- a/nix/windows-release.nix +++ b/nix/windows-release.nix @@ -1,5 +1,5 @@ ############################################################################ -# Windows release cardano-rt-view-service-*.zip +# Windows release cardano-rt-view-*.zip # # This bundles up the windows executable with its dependencies # and static directory. @@ -14,8 +14,8 @@ let lib = pkgs.lib; - name = "cardano-rt-view-service-${project.version}-win64"; - rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view-service" exe.name) exes); + name = "cardano-rt-view-${project.version}-win64"; + rtViewServiceExe = lib.head (lib.filter (exe: lib.hasInfix "cardano-rt-view" exe.name) exes); in pkgs.runCommand name { buildInputs = with pkgs.buildPackages; [ diff --git a/release.nix b/release.nix index c8848e2..6c38eb7 100644 --- a/release.nix +++ b/release.nix @@ -90,17 +90,17 @@ let in (mapTestOn (__trace (__toJSON filteredBuilds) filteredBuilds)); musl64 = mapTestOnCross musl64 (packagePlatformsCross (filterProject noMusl64Build)); "${mingwW64.config}" = mapTestOnCross mingwW64 (packagePlatformsCross (filterProject noCrossBuild)); - cardano-rt-view-service-win64-release = import ./nix/windows-release.nix { + cardano-rt-view-win64-release = import ./nix/windows-release.nix { inherit pkgs project; exes = collectJobs jobs.${mingwW64.config}.exes.cardano-rt-view; staticDir = ./static; }; - cardano-rt-view-service-linux-release = import ./nix/linux-release.nix { + cardano-rt-view-linux-release = import ./nix/linux-release.nix { inherit pkgs project; exes = collectJobs jobs.musl64.exes.cardano-rt-view; staticDir = ./static; }; - cardano-rt-view-service-darwin-release = import ./nix/darwin-release.nix { + cardano-rt-view-darwin-release = import ./nix/darwin-release.nix { inherit (pkgsFor "x86_64-darwin") pkgs; inherit project; exes = filter (p: p.system == "x86_64-darwin") (collectJobs jobs.native.exes.cardano-rt-view); @@ -110,9 +110,9 @@ let (collectJobs jobs.native.checks) (collectJobs jobs.native.benchmarks) (collectJobs jobs.native.exes) - (optional windowsBuild jobs.cardano-rt-view-service-win64-release) - (optional linuxBuild jobs.cardano-rt-view-service-linux-release) - (optional darwinBuild jobs.cardano-rt-view-service-darwin-release) + (optional windowsBuild jobs.cardano-rt-view-win64-release) + (optional linuxBuild jobs.cardano-rt-view-linux-release) + (optional darwinBuild jobs.cardano-rt-view-darwin-release) ])); in jobs diff --git a/src/Cardano/RTView/Config.hs b/src/Cardano/RTView/Config.hs index 916bb3e..f21075b 100644 --- a/src/Cardano/RTView/Config.hs +++ b/src/Cardano/RTView/Config.hs @@ -52,7 +52,7 @@ import Cardano.RTView.CLI (RTViewParams (..), defaultRTViewParams, def -- 2. By providing configuration explicitly. If `--config`, `--static` and `--port` -- options are provided, these values will be used (interactive dialog will be skipped). -- 3. By using the last used configuration. If the user already launched --- `cardano-rt-view-service` previously, the configuration was stored in +-- `cardano-rt-view` previously, the configuration was stored in -- user's local directory (different for each supported platform), -- and by default that configuration will be used again. prepareConfigAndParams @@ -80,7 +80,7 @@ prepareConfigAndParams params' = do configFileIsProvided :: RTViewParams -> Bool configFileIsProvided params = not . null $ rtvConfig params --- | Reads the service' configuration file (path is passed via '--config' CLI option). +-- | Reads the program's configuration file (path is passed via '--config' CLI option). readConfigFile :: FilePath -> IO Configuration readConfigFile pathToConfig = setup pathToConfig `catch` exceptHandler where @@ -98,7 +98,7 @@ readRTViewParamsFile pathToParams = <> pathToParams <> ", exception: " <> show e Right (params :: RTViewParams) -> return params --- | If `cardano-rt-view-service` already ws used on this computer, +-- | If `cardano-rt-view` already ws used on this computer, -- the configuration was saved in user's local directory, which -- differs on different platforms. savedConfigurationFile :: IO FilePath @@ -150,7 +150,7 @@ startDialogToPrepareConfig = do <> showDefaultNodesNames nodesNumber <> "\"): " nodesNames <- askAboutNodesNames nodesNumber - TIO.putStrLn $ "Indicate the port for the web service (" <> show minimumPort + TIO.putStrLn $ "Indicate the port for the web server (" <> show minimumPort <> " - " <> show maximumPort <> ", default is " <> show defaultRTVPort <> "): " port <- askAboutWebPort @@ -168,7 +168,7 @@ startDialogToPrepareConfig = do <> show defaultFirstPortForSockets <> "): " askAboutFirstPortForSockets nodesNumber - TIO.putStrLn $ "Indicate the directory with static content for the web service, default is \"" + TIO.putStrLn $ "Indicate the directory with static content for the web server, default is \"" <> T.pack defaultRTVStatic <> "\":" staticDir <- askAboutStaticDir @@ -303,7 +303,7 @@ askAboutWebPort = do <> show maximumPort <> ": " askAboutWebPort else do - TIO.putStrLn $ "Ok, the service will be listening on http://127.0.0.1:" <> show port + TIO.putStrLn $ "Ok, the server will be listening on http://127.0.0.1:" <> show port return port data ConnectionWay @@ -414,7 +414,7 @@ saveRTViewParamsForNextSessions params = do path <- savedRTViewParamsFile encodeFile path params --- | RTView service requires at least one |TraceAcceptor|. +-- | RTView requires at least one |TraceAcceptor|. checkIfTraceAcceptorIsDefined :: Configuration -> IO [RemoteAddrNamed] diff --git a/test/README.md b/test/README.md index 671a8b6..98405dc 100644 --- a/test/README.md +++ b/test/README.md @@ -5,11 +5,11 @@ RTView is a separate process that receives `LogObject`s from another process (for example, `cardano-node`) and displays them on HTML-page. It can be shown like this: ``` -Process 1 Process 2 Process 3 -+--------------+ [LogObject] +-------------------------+ web-requests +-------------+ -| cardano-node | ------------> | cardano-rt-view-service | <-------------- | web browser | -+--------------+ +-------------------------+ --------------> +-------------+ - HTML-page +Process 1 Process 2 Process 3 ++--------------+ [LogObject] +-----------------+ web-requests +-------------+ +| cardano-node | ------------> | cardano-rt-view | <-------------- | web browser | ++--------------+ +-----------------+ --------------> +-------------+ + HTML-page ``` To test it automatically, we use additional scripts and programs: @@ -20,19 +20,19 @@ To test it automatically, we use additional scripts and programs: It can be shown like this: ``` - Process 1 Process 2 - +-----------+ [LogObject] +-------------------------+ web-requests +----------+ -logObjects.json --> | sender.sh | ------------> | cardano-rt-view-service | <-------------- | analyzer | - +-----------+ +-------------------------+ --------------> +----------+ - HTML-page + Process 1 Process 2 + +-----------+ [LogObject] +-----------------+ web-requests +----------+ +logObjects.json --> | sender.sh | ------------> | cardano-rt-view | <-------------- | analyzer | + +-----------+ +-----------------+ --------------> +----------+ + HTML-page ``` Please note that `analyzer` doesn't analyze RTView UI (complete HTML-page) by itself. Instead, it launches the real web browser and use it to analyze the page automatically, using Selenium standalone server and `webdriver` package. It can be shown like this: ``` -+----------+ +-------------+ +---------+ web-commands +-------------------------+ -| analyzer | ----> | GeckoDriver | ----> | Firefox | -------------> | cardano-rt-view-service | -+----------+ +-------------+ +---------+ +-------------------------+ ++----------+ +-------------+ +---------+ web-commands +-----------------+ +| analyzer | ----> | GeckoDriver | ----> | Firefox | -------------> | cardano-rt-view | ++----------+ +-------------+ +---------+ +-----------------+ \ \ +-----------------+ `-------> | Selenium server | @@ -44,7 +44,7 @@ Please note that `analyzer` doesn't analyze RTView UI (complete HTML-page) by it Please make sure you have these commands in your `PATH`: 1. `jq` to minimize predefined JSON-file with `LogObject`s. -2. `nc` to send `LogObject`s from predefined JSON-file to `cardano-rt-view-service` (via UNIX socket). +2. `nc` to send `LogObject`s from predefined JSON-file to `cardano-rt-view` (via UNIX socket). 3. `firefix` to interact with RTView UI (complete HTML-page), 4. `geckodriver` to interact with Firefox, 5. `java` to launch `selenium-server-standalone`. @@ -55,7 +55,7 @@ Please note that you have to provide full path to `selenium-server-standalone` f Run `./runTest.sh PATH_TO_SELENIUM_SERVER_JAR` script which launches: -1. `cardano-rt-view-service` process (in the background), +1. `cardano-rt-view` process (in the background), 2. `sender.sh` script, 3. `selenium-server-standalone` process (in the background), 4. `analyzer` process. diff --git a/test/rt-view-analyzer/src/Main.hs b/test/rt-view-analyzer/src/Main.hs index 5f7a60e..7c0a8dc 100644 --- a/test/rt-view-analyzer/src/Main.hs +++ b/test/rt-view-analyzer/src/Main.hs @@ -25,7 +25,7 @@ main = do (nodeName, unixSocket) <- getAcceptorInfoFrom rtViewConfig runSession wdConfig . closeOnException $ do - -- We always test cardano-rt-view-service launched locally, so we only need a web port. + -- We always test cardano-rt-view launched locally, so we only need a web port. let rtViewPageURL = "http://127.0.0.1:" <> show rtViewWebPort openPage rtViewPageURL waitFor 2 Seconds diff --git a/test/runTest.sh b/test/runTest.sh index 4d0f836..14fb0a5 100755 --- a/test/runTest.sh +++ b/test/runTest.sh @@ -5,7 +5,7 @@ BASEDIR=$(realpath $(dirname "$0")) . "${BASEDIR}"/../../scripts/common.sh -prebuild 'cardano-rt-view-service' || exit 1 +prebuild 'cardano-rt-view' || exit 1 prebuild 'rt-view-analyzer' || exit 1 set -e @@ -14,7 +14,7 @@ readonly JSON_WITH_LOG_OBJECTS=logObjects.json readonly UNIX_SOCKET=./logs/rt-view-pipe-0 readonly SELENIUM_SERVER_JAR=$1 -readonly RT_VIEW_EXE=cardano-rt-view-service +readonly RT_VIEW_EXE=cardano-rt-view readonly RT_VIEW_CONFIG=rt-view-config.yaml readonly RT_VIEW_STATIC_DIR=../static readonly RT_VIEW_WEB_PORT=8024 @@ -22,7 +22,7 @@ readonly RT_VIEW_WEB_PORT=8024 echo "Remove old UNIX-socket..." rm -f "${UNIX_SOCKET}" -echo "Launch cardano-rt-view-service..." +echo "Launch cardano-rt-view..." run "${RT_VIEW_EXE}" --config "${RT_VIEW_CONFIG}" \ --static "${RT_VIEW_STATIC_DIR}" \ --port "${RT_VIEW_WEB_PORT}" & @@ -49,11 +49,11 @@ sleep 1 kill ${PID_SELENIUM} sleep 1 -## Stop cardano-rt-view-service. +## Stop cardano-rt-view. kill $(pgrep -f ${RT_VIEW_EXE}) sleep 1 -# Remove cardano-rt-view-service' logs. +# Remove cardano-rt-view' logs. rm -rf logs # Remove nohup artifacts