Closed therustmonk closed 8 months ago
provide a universal abstraction for controlling a deployment of Tari products
Don't forget three of the containers are not Tari products. Grafana, Loki, and Promtail will also be utilizing the same abstraction.
Don't forget three of the containers are not Tari products. Grafana, Loki, and Promtail will also be utilizing the same abstraction.
Yeah, good point :ok_hand:
The problem
We have a dispersed integration between the backend and frontend: a set of methods that called independently to control images and containers. The state of running containers managed partially by both parts that makes debugging too difficult.
Also we use multiple instances to interact with docker:
Workspaces
,DockerWrapper
, anAppState
with aDocker
instance inside the wrapper, and global standaloneDocker
instance.There is no a single part responsible for managing containers. For example, we have to monitor docker's events to subscribe for a GRPC stream from a wallet container that makes UI's code confusing and tricky for debugging.
The solution
We need a single self-sufficient crate to manage a set of images and containers to mantain a node of the Tari Network.
That crate could provide a universal abstraction for controlling a deployment of Tari products (Base Node, Mining Node, Wallet). The unified approach gives serious benefits:
Implementation
The library can be implemented as a crate that has a method to get a stream of events and a method to send events.
The crate could work as a library and as a binary CLI tool.
Tauri Platform integration
For using the crate with the
tauri
platform we could add a method to subscribe to that stream of events that will be forwarder totauri
events bus. Control events could be sent using a method call.