Skip to content

Commit

Permalink
gasp-avs metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Jan 21, 2025
1 parent 6c18a20 commit 5643b7a
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 20 deletions.
160 changes: 141 additions & 19 deletions gasp-avs/Cargo.lock

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

5 changes: 4 additions & 1 deletion gasp-avs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ tokio = { version = "1.37.0", features = ["full"] }
tracing = "0.1.40"
tracing-error = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["json", "env-filter"] }
prometheus = { version = "0.13.3", default-features = false }
lazy_static = "1.5.0"
warp = "0.3.7"

# Polkadot SDK

Expand All @@ -51,4 +54,4 @@ substrate-rpc-client = { git = "https://github.com/mangata-finance/polkadot-sdk"
sc-rpc-api = { git = "https://github.com/mangata-finance/polkadot-sdk", branch = "eth-rollup-develop" }

codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
array-bytes = { version = "6.2.0" }
array-bytes = { version = "6.2.0" }
12 changes: 12 additions & 0 deletions gasp-avs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use chainio::setup_deposits;
use cli::CliArgs;
use ethers::signers::Signer;
use eyre::{eyre, Ok};
use operator::Operator;
use std::sync::Arc;
Expand All @@ -8,6 +9,7 @@ use tracing::{info, instrument, warn};
mod chainio;
mod cli;
mod crypto;
mod metrics;
mod operator;
mod rpc;

Expand All @@ -18,6 +20,16 @@ pub async fn start() -> eyre::Result<()> {
serde_json::to_string_pretty(&cli)?
);
let operator = Operator::from_cli(&cli).await?;
let address = operator.signer().address();
let client = operator.client();

let _http_server = tokio::spawn(async move {
metrics::serve_metrics(80).await;
});

let _monitor_balance = tokio::spawn(async move {
metrics::report_account_balance(address, client).await;
});

if let Some(cmd) = &cli.command {
info!("Operator created with command '{:?}'", cmd);
Expand Down
Loading

0 comments on commit 5643b7a

Please sign in to comment.