Browse Source

map: created stub irc tui

lunar-mining 4 years ago
parent
commit
4cb5542d6d
2 changed files with 41 additions and 0 deletions
  1. 10 0
      bin/map/Cargo.toml
  2. 31 0
      bin/map/src/main.rs

+ 10 - 0
bin/map/Cargo.toml

@@ -0,0 +1,10 @@
+[package]
+name = "map"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+darkfi = { path = "../../" , features = ['tui']}
+smol = "1.2.5"

+ 31 - 0
bin/map/src/main.rs

@@ -0,0 +1,31 @@
+// tui that lists:
+//      all active nodes
+//      their connections
+//      recent messages
+//
+// uses rpc to get that info from nodes
+//
+// later: can open nodes in tabs
+
+use drk::{
+    tui::{App, HBox, VBox, Widget},
+    Result,
+};
+
+async fn start() -> Result<()> {
+    let wv1 = vec![Widget::new("Active nodes".into())?];
+
+    let v_box1 = Box::new(VBox::new(wv1.clone(), 1));
+
+    let mut app = App::new()?;
+
+    app.add_layout(v_box1)?;
+
+    app.run().await?;
+
+    Ok(())
+}
+
+fn main() -> Result<()> {
+    smol::future::block_on(start())
+}