map: created stub irc tui

This commit is contained in:
lunar-mining
2022-01-05 18:59:02 +01:00
parent 7ed58b0d2c
commit 4cb5542d6d
2 changed files with 41 additions and 0 deletions

10
bin/map/Cargo.toml Normal file
View File

@@ -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
bin/map/src/main.rs Normal file
View File

@@ -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())
}