Skip to content

Commit

Permalink
status monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 25, 2024
1 parent aa519c5 commit 92dd631
Show file tree
Hide file tree
Showing 20 changed files with 1,053 additions and 128 deletions.
101 changes: 100 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kaspa-resolver"
description = "Kaspa wRPC endpoint resolver and monitor"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
# authors.workspace = true
# include.workspace = true
Expand Down Expand Up @@ -46,6 +46,7 @@ sparkle-rpc-client = { git = "https://github.com/aspectron/sparkle.git", branch

ahash = "0.8.6"
arc-swap = "1.7.1"
askama = "0.12.1"
async-trait = "0.1.51"
axum = "0.7.4"
borsh = "1.5.1"
Expand All @@ -71,6 +72,7 @@ toml = "0.8.8"
tower = { version = "0.4.13", features = ["buffer","limit"] }
tower-http = { version = "0.5.1", features = ["cors"] }
tracing-subscriber = "0.3.18"
uuid = "1"
xxhash-rust = { version = "0.8.7", features = ["xxh3"] }

# argon2 = "0.5.2"
Expand Down
15 changes: 12 additions & 3 deletions Resolver.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
[http.status]
sessions = 128
ttl-hrs = 48

[limits]
fd = 8192

[sync]
poll = 1000
ping = 3500
poll-sec = 1.0
ping-sec = 3.5

[ttl]
enable = true
period-hrs = 24
noise = 0.3

[updates]
url = "https://raw.githubusercontent.com/aspectron/kaspa-resolver/master/data/"
duration = 12.0 # hours
duration-hrs = 12.0

10 changes: 5 additions & 5 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ pub struct Args {
pub trace: bool,
// Show node data on each election
// pub election: bool,
/// Enable resolver status access via `/status`
pub status: bool,
// Enable resolver status access via `/status`
// pub status: bool,
/// Action to execute
pub action: Action,
}
Expand All @@ -42,7 +42,7 @@ impl Args {
.arg(arg!(--verbose "Enable verbose logging"))
.arg(arg!(--trace "Enable trace log level"))
// .arg(arg!(--election "Show node data on each election"))
.arg(arg!(--status "Enable `/status` endpoint"))
// .arg(arg!(--status "Enable `/status` endpoint"))
.arg(
Arg::new("rate-limit")
.long("rate-limit")
Expand Down Expand Up @@ -72,7 +72,7 @@ impl Args {
let trace = matches.get_one::<bool>("trace").cloned().unwrap_or(false);
let verbose = matches.get_one::<bool>("verbose").cloned().unwrap_or(false);
// let election = matches.get_one::<bool>("election").cloned().unwrap_or(false);
let status = matches.get_one::<bool>("status").cloned().unwrap_or(false);
// let status = matches.get_one::<bool>("status").cloned().unwrap_or(false);

let rate_limit = matches.get_one::<RateLimit>("rate-limit").cloned();
let listen = matches
Expand Down Expand Up @@ -101,7 +101,7 @@ impl Args {
trace,
verbose,
// election,
status,
// status,
listen,
rate_limit,
action,
Expand Down
Loading

0 comments on commit 92dd631

Please sign in to comment.