Skip to content

Commit

Permalink
Serve some basic config info at /info.
Browse files Browse the repository at this point in the history
  • Loading branch information
grao1991 committed Oct 2, 2024
1 parent 6879371 commit b8de1d5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions api/src/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,48 @@ impl BasicApi {
Html(OPEN_API_HTML.to_string())
}

/// Show some basic info of the node.
#[oai(
path = "/info",
method = "get",
operation_id = "info",
tag = "ApiTags::General"
)]
async fn info(&self) -> Html<String> {
let rows = [
format!(
"<p> Bootstrapping Mode: {:?} </p>",
self.context
.node_config
.state_sync
.state_sync_driver
.bootstrapping_mode
),
format!(
"<p> Continuous Syncing Mode: {:?} </p>",
self.context
.node_config
.state_sync
.state_sync_driver
.continuous_syncing_mode
),
format!(
"<p> New Storage Format: {:?} </p>",
self.context
.node_config
.storage
.rocksdb_configs
.enable_storage_sharding
),
format!(
"<p> Internal Indexer Config: {:?} </p>",
self.context.node_config.indexer_db_config
),
];
let html = rows.join("\n");
Html(html)
}

/// Check basic node health
///
/// By default this endpoint just checks that it can get the latest ledger
Expand Down

0 comments on commit b8de1d5

Please sign in to comment.