mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-06 21:34:00 -05:00
map: created stub irc tui
This commit is contained in:
10
bin/map/Cargo.toml
Normal file
10
bin/map/Cargo.toml
Normal 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
31
bin/map/src/main.rs
Normal 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())
|
||||
}
|
||||
Reference in New Issue
Block a user