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

@@ -155,7 +155,7 @@ impl Transactions {
// Explorer configuration
#[derive(Debug)]
pub struct ExplorerConfig {
pub ip: String,
pub host: String,
pub port: String,
pub proto: String,
pub user: String,
@@ -166,12 +166,13 @@ pub struct ExplorerConfig {
pub foreign_api_secret: String,
pub coingecko_api: String,
pub public_api: String,
pub external_nodes: Vec<String>,
}
impl ExplorerConfig {
pub fn new() -> ExplorerConfig {
ExplorerConfig {
ip: String::new(),
host: String::new(),
port: String::new(),
proto: String::new(),
user: String::new(),
@@ -182,10 +183,12 @@ impl ExplorerConfig {
foreign_api_secret: String::new(),
coingecko_api: String::new(),
public_api: String::new(),
external_nodes: Vec::new(),
}
}
}
// Output data
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Output {
@@ -208,3 +211,22 @@ impl Output {
}
}
// Statistics data
#[derive(Debug)]
pub struct Statistics {
pub user_agent: Vec<String>,
pub count: Vec<String>,
pub total: u32,
}
impl Statistics {
pub fn new() -> Statistics {
Statistics {
user_agent: Vec::new(),
count: Vec::new(),
total: 0,
}
}
}