adding node stats

This commit is contained in:
aglkm
2024-09-19 01:05:33 +03:00
parent 45c6678c70
commit 1d2ab82daf
10 changed files with 738 additions and 361 deletions

View File

@@ -1,18 +1,20 @@
use std::sync::{Arc, Mutex};
use crate::data::Dashboard;
use crate::data::Block;
use crate::data::Dashboard;
use crate::data::Statistics;
use crate::data::Transactions;
use crate::requests;
// Tokio Runtime Worker.
// Collecting all the data.
pub async fn run(dash: Arc<Mutex<Dashboard>>, blocks: Arc<Mutex<Vec<Block>>>,
txns: Arc<Mutex<Transactions>>) -> Result<(), anyhow::Error> {
txns: Arc<Mutex<Transactions>>, stats: Arc<Mutex<Statistics>>) -> Result<(), anyhow::Error> {
let _ = requests::get_status(dash.clone()).await?;
let _ = requests::get_mempool(dash.clone()).await?;
let _ = requests::get_connected_peers(dash.clone()).await?;
let _ = requests::get_connected_peers(dash.clone(), stats.clone()).await?;
let _ = requests::get_market(dash.clone()).await?;
requests::get_disk_usage(dash.clone())?;
let _ = requests::get_mining_stats(dash.clone()).await?;