feat: add `mix xomg.watcher_info.start`
MODIFY
apps/xomg_tasks/lib/mix/tasks/child_chain.ex
apps/xomg_tasks/lib/mix/tasks/child_chain.ex
defmodule Mix.Tasks.Xomg.ChildChain.Start do
@moduledoc """
- Contains mix.task to run the child chain server
+ Contains mix.task to run the child chain server.
"""
use Mix.Task
import XomgTasks.Utils
- @shortdoc "Start the child chain server. See Mix.Tasks.ChildChain"
+ @shortdoc "Start the child chain server. See Mix.Tasks.Xomg.ChildChain.Start."
def run(args) do
args

MODIFY
apps/xomg_tasks/lib/mix/tasks/watcher.ex
apps/xomg_tasks/lib/mix/tasks/watcher.ex
defmodule Mix.Tasks.Xomg.Watcher.Start do
@moduledoc """
- Contains mix.task to run the watcher in different modes:
- a) mix xomg.watcher.start ----> security critical
- b) mix xomg.watcher.start --convenience ----> security critical + convenience api
+ Contains mix.task to run the watcher in security-critical only modes.
See the README.md file.
"""
@@ -24,17 +22,9 @@ defmodule Mix.Tasks.Xomg.Watcher.Start do
import XomgTasks.Utils
- @shortdoc "Starts the watcher. See Mix.Tasks.Watcher for possible options"
-
- def run(["--convenience" | args]) do
- start_watcher(args)
- end
+ @shortdoc "Starts the security-critical watcher. See Mix.Tasks.Watcher."
def run(args) do
- start_watcher(args)
- end
-
- defp start_watcher(args) do
args
|> generic_prepare_args()
|> generic_run([:omg_watcher, :omg_watcher_rpc])

ADD
apps/xomg_tasks/lib/mix/tasks/watcher_info.ex
+# Copyright 2019 OmiseGO Pte Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+defmodule Mix.Tasks.Xomg.WatcherInfo.Start do
+ @moduledoc """
+ Contains mix.task to run the watcher in security-critical + informational mode.
+
+ See the README.md file.
+ """
+ use Mix.Task
+
+ import XomgTasks.Utils
+
+ @shortdoc "Starts the security-critical + informational watcher. See Mix.Tasks.Xomg.WatcherInfo.Start."
+
+ def run(args) do
+ args
+ |> generic_prepare_args()
+ |> generic_run([:omg_watcher_info, :omg_watcher_rpc])
+ end
+end

MODIFY
apps/xomg_tasks/lib/utils.ex
apps/xomg_tasks/lib/utils.ex
@@ -60,7 +60,7 @@ defmodule XomgTasks.Utils do
# mix loads entire codebase which fools `Response.add_version`
defp ensure_one_rpc_loaded(apps) do
- if Enum.member?(apps, :omg_watcher) do
+ if Enum.member?(apps, :omg_watcher) || Enum.member?(apps, :omg_watcher_info) do
true = :code.delete(OMG.ChildChainRPC)
:code.purge(OMG.ChildChainRPC)
end

feat: add `mix xomg.watcher_info.start` (#1205)